Skip to content

Commit 0f797e3

Browse files
committed
---
yaml --- r: 88881 b: refs/heads/snap-stage3 c: 3f444dc h: refs/heads/master i: 88879: d309cc8 v: v3
1 parent be1e2c0 commit 0f797e3

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: efdbd60a87d8a997df39907cf11ecfa5a8ba707e
4+
refs/heads/snap-stage3: 3f444dca5b8d32b8fd64256ec7ffc55b480d84ea
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ struct ctxt_ {
297297

298298
impl_trait_cache: RefCell<HashMap<ast::DefId, Option<@ty::TraitRef>>>,
299299

300-
trait_refs: @mut HashMap<NodeId, @TraitRef>,
300+
trait_refs: RefCell<HashMap<NodeId, @TraitRef>>,
301301
trait_defs: @mut HashMap<DefId, @TraitDef>,
302302

303303
/// Despite its name, `items` does not only map NodeId to an item but
@@ -986,7 +986,7 @@ pub fn mk_ctxt(s: session::Session,
986986
region_maps: region_maps,
987987
node_types: @mut HashMap::new(),
988988
node_type_substs: RefCell::new(HashMap::new()),
989-
trait_refs: @mut HashMap::new(),
989+
trait_refs: RefCell::new(HashMap::new()),
990990
trait_defs: @mut HashMap::new(),
991991
items: amap,
992992
intrinsic_defs: @mut HashMap::new(),
@@ -2654,7 +2654,8 @@ pub fn index_sty(sty: &sty) -> Option<mt> {
26542654
}
26552655

26562656
pub fn node_id_to_trait_ref(cx: ctxt, id: ast::NodeId) -> @ty::TraitRef {
2657-
match cx.trait_refs.find(&id) {
2657+
let trait_refs = cx.trait_refs.borrow();
2658+
match trait_refs.get().find(&id) {
26582659
Some(&t) => t,
26592660
None => cx.sess.bug(
26602661
format!("node_id_to_trait_ref: no trait ref for node `{}`",

branches/snap-stage3/src/librustc/middle/typeck/collect.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,9 @@ pub fn instantiate_trait_ref(ccx: &CrateCtxt,
710710
let trait_ref =
711711
astconv::ast_path_to_trait_ref(
712712
ccx, &rscope, trait_did, Some(self_ty), &ast_trait_ref.path);
713-
ccx.tcx.trait_refs.insert(
714-
ast_trait_ref.ref_id, trait_ref);
713+
714+
let mut trait_refs = ccx.tcx.trait_refs.borrow_mut();
715+
trait_refs.get().insert(ast_trait_ref.ref_id, trait_ref);
715716
return trait_ref;
716717
}
717718
_ => {

0 commit comments

Comments
 (0)