Skip to content

Commit fe6c471

Browse files
committed
---
yaml --- r: 96957 b: refs/heads/dist-snap c: 3f444dc h: refs/heads/master i: 96955: 205bfac v: v3
1 parent ee162ce commit fe6c471

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
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: efdbd60a87d8a997df39907cf11ecfa5a8ba707e
9+
refs/heads/dist-snap: 3f444dca5b8d32b8fd64256ec7ffc55b480d84ea
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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)