Skip to content

Commit 645cc57

Browse files
committed
---
yaml --- r: 92779 b: refs/heads/auto c: 1f76a9b h: refs/heads/master i: 92777: 1901338 92775: 24d1519 v: v3
1 parent 72eacc7 commit 645cc57

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: f62faa89edb16a340a0be471037301ebf1457919
16+
refs/heads/auto: 1f76a9ba5ef3b9b1f903ef3fd0f932972566720c
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/ty.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ struct ctxt_ {
364364

365365
// The set of external traits whose implementations have been read. This
366366
// is used for lazy resolution of traits.
367-
populated_external_traits: @mut HashSet<ast::DefId>,
367+
populated_external_traits: RefCell<HashSet<ast::DefId>>,
368368

369369
// These two caches are used by const_eval when decoding external statics
370370
// and variants that are found.
@@ -1008,7 +1008,7 @@ pub fn mk_ctxt(s: session::Session,
10081008
used_mut_nodes: RefCell::new(HashSet::new()),
10091009
impl_vtables: RefCell::new(HashMap::new()),
10101010
populated_external_types: RefCell::new(HashSet::new()),
1011-
populated_external_traits: @mut HashSet::new(),
1011+
populated_external_traits: RefCell::new(HashSet::new()),
10121012

10131013
extern_const_statics: RefCell::new(HashMap::new()),
10141014
extern_const_variants: RefCell::new(HashMap::new()),
@@ -4589,8 +4589,12 @@ pub fn populate_implementations_for_trait_if_necessary(
45894589
if trait_id.crate == LOCAL_CRATE {
45904590
return
45914591
}
4592-
if tcx.populated_external_traits.contains(&trait_id) {
4593-
return
4592+
{
4593+
let populated_external_traits = tcx.populated_external_traits
4594+
.borrow();
4595+
if populated_external_traits.get().contains(&trait_id) {
4596+
return
4597+
}
45944598
}
45954599

45964600
csearch::each_implementation_for_trait(tcx.sess.cstore, trait_id,
@@ -4615,7 +4619,9 @@ pub fn populate_implementations_for_trait_if_necessary(
46154619
impls.get().insert(implementation_def_id, implementation);
46164620
});
46174621

4618-
tcx.populated_external_traits.insert(trait_id);
4622+
let mut populated_external_traits = tcx.populated_external_traits
4623+
.borrow_mut();
4624+
populated_external_traits.get().insert(trait_id);
46194625
}
46204626

46214627
/// Given the def_id of an impl, return the def_id of the trait it implements.

0 commit comments

Comments
 (0)