Skip to content

Commit 2f2f145

Browse files
committed
---
yaml --- r: 15817 b: refs/heads/try c: 8448711 h: refs/heads/master i: 15815: 6c6a973 v: v3
1 parent ecc8bce commit 2f2f145

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: bdef90730ec0187454545679f9d3bd26d8f042fa
5+
refs/heads/try: 8448711534904cabae76795bf771e0275365c8ef
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/typeck/collect.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ fn check_methods_against_iface(ccx: @crate_ctxt,
115115

116116
fn convert_class_item(ccx: @crate_ctxt,
117117
rp: ast::region_param,
118+
bounds: @[ty::param_bounds],
118119
v: ast_util::ivar) {
119120
/* we want to do something here, b/c within the
120121
scope of the class, it's ok to refer to fields &
@@ -123,6 +124,8 @@ fn convert_class_item(ccx: @crate_ctxt,
123124
class. outside the class, it's done with expr_field */
124125
let tt = ccx.to_ty(type_rscope(rp), v.ty);
125126
write_ty_to_tcx(ccx.tcx, v.id, tt);
127+
/* add the field to the tcache */
128+
ccx.tcx.tcache.insert(local_def(v.id), {bounds: bounds, rp: rp, ty: tt});
126129
}
127130

128131
fn convert_methods(ccx: @crate_ctxt,
@@ -228,6 +231,8 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
228231
// Write the class type
229232
let tpt = ty_of_item(ccx, it);
230233
write_ty_to_tcx(tcx, it.id, tpt.ty);
234+
tcx.tcache.insert(local_def(it.id), {bounds: tpt.bounds,
235+
rp: rp, ty: tpt.ty});
231236
// Write the ctor type
232237
let t_ctor =
233238
ty::mk_fn(
@@ -264,7 +269,7 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
264269
// Write the type of each of the members
265270
let (fields, methods) = split_class_items(members);
266271
for fields.each {|f|
267-
convert_class_item(ccx, rp, f);
272+
convert_class_item(ccx, rp, tpt.bounds, f);
268273
}
269274
// The selfty is just the class type
270275
let {bounds:_, substs} = mk_substs(ccx, tps, rp);

0 commit comments

Comments
 (0)