Skip to content

Commit c194489

Browse files
committed
---
yaml --- r: 97018 b: refs/heads/dist-snap c: 55a7b2f h: refs/heads/master v: v3
1 parent 8db3ce8 commit c194489

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
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: 42f7f7f437ad978dd95d3ec39a0f231d6cd161da
9+
refs/heads/dist-snap: 55a7b2feddfd54f5a4c5f4dd85d156a0da50428e
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
10841084
item_impl(_, ref opt_trait, ty, ref ast_methods) => {
10851085
// We need to encode information about the default methods we
10861086
// have inherited, so we drive this based on the impl structure.
1087-
let imp = tcx.impls.get(&def_id);
1087+
let impls = tcx.impls.borrow();
1088+
let imp = impls.get().get(&def_id);
10881089

10891090
add_to_index();
10901091
ebml_w.start_tag(tag_items_data_item);

branches/dist-snap/src/librustc/middle/trans/meth.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ pub fn method_with_name(ccx: &CrateContext,
305305
}
306306
}
307307

308-
let imp = ccx.tcx.impls.find(&impl_id)
308+
let impls = ccx.tcx.impls.borrow();
309+
let imp = impls.get().find(&impl_id)
309310
.expect("could not find impl while translating");
310311
let meth = imp.methods.iter().find(|m| m.ident.name == name)
311312
.expect("could not find method while translating");

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ struct ctxt_ {
344344
// Note that this contains all of the impls that we know about,
345345
// including ones in other crates. It's not clear that this is the best
346346
// way to do it.
347-
impls: @mut HashMap<ast::DefId, @Impl>,
347+
impls: RefCell<HashMap<ast::DefId, @Impl>>,
348348

349349
// Set of used unsafe nodes (functions or blocks). Unsafe nodes not
350350
// present in this set can be warned about.
@@ -1007,7 +1007,7 @@ pub fn mk_ctxt(s: session::Session,
10071007
destructors: RefCell::new(HashSet::new()),
10081008
trait_impls: RefCell::new(HashMap::new()),
10091009
inherent_impls: RefCell::new(HashMap::new()),
1010-
impls: @mut HashMap::new(),
1010+
impls: RefCell::new(HashMap::new()),
10111011
used_unsafe: @mut HashSet::new(),
10121012
used_mut_nodes: @mut HashSet::new(),
10131013
impl_vtables: @mut HashMap::new(),
@@ -4563,7 +4563,8 @@ pub fn populate_implementations_for_type_if_necessary(tcx: ctxt,
45634563
}
45644564

45654565
// Store the implementation info.
4566-
tcx.impls.insert(implementation_def_id, implementation);
4566+
let mut impls = tcx.impls.borrow_mut();
4567+
impls.get().insert(implementation_def_id, implementation);
45674568
});
45684569

45694570
tcx.populated_external_types.insert(type_id);
@@ -4599,7 +4600,8 @@ pub fn populate_implementations_for_trait_if_necessary(
45994600
}
46004601

46014602
// Store the implementation info.
4602-
tcx.impls.insert(implementation_def_id, implementation);
4603+
let mut impls = tcx.impls.borrow_mut();
4604+
impls.get().insert(implementation_def_id, implementation);
46034605
});
46044606

46054607
tcx.populated_external_traits.insert(trait_id);

branches/dist-snap/src/librustc/middle/typeck/coherence.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ impl CoherenceChecker {
313313
}
314314
}
315315

316-
tcx.impls.insert(implementation.did, implementation);
316+
let mut impls = tcx.impls.borrow_mut();
317+
impls.get().insert(implementation.did, implementation);
317318
}
318319

319320
// Creates default method IDs and performs type substitutions for an impl
@@ -665,7 +666,8 @@ impl CoherenceChecker {
665666
}
666667
}
667668

668-
tcx.impls.insert(implementation.did, implementation);
669+
let mut impls = tcx.impls.borrow_mut();
670+
impls.get().insert(implementation.did, implementation);
669671
}
670672

671673
// Adds implementations and traits from external crates to the coherence

0 commit comments

Comments
 (0)