@@ -360,7 +360,7 @@ struct ctxt_ {
360
360
361
361
// The set of external nominal types whose implementations have been read.
362
362
// This is used for lazy resolution of methods.
363
- populated_external_types : @ mut HashSet < ast:: DefId > ,
363
+ populated_external_types : RefCell < HashSet < ast:: DefId > > ,
364
364
365
365
// The set of external traits whose implementations have been read. This
366
366
// is used for lazy resolution of traits.
@@ -1007,7 +1007,7 @@ pub fn mk_ctxt(s: session::Session,
1007
1007
used_unsafe : RefCell :: new ( HashSet :: new ( ) ) ,
1008
1008
used_mut_nodes : RefCell :: new ( HashSet :: new ( ) ) ,
1009
1009
impl_vtables : RefCell :: new ( HashMap :: new ( ) ) ,
1010
- populated_external_types : @ mut HashSet :: new ( ) ,
1010
+ populated_external_types : RefCell :: new ( HashSet :: new ( ) ) ,
1011
1011
populated_external_traits : @mut HashSet :: new ( ) ,
1012
1012
1013
1013
extern_const_statics : RefCell :: new ( HashMap :: new ( ) ) ,
@@ -4525,8 +4525,11 @@ pub fn populate_implementations_for_type_if_necessary(tcx: ctxt,
4525
4525
if type_id. crate == LOCAL_CRATE {
4526
4526
return
4527
4527
}
4528
- if tcx. populated_external_types . contains ( & type_id) {
4529
- return
4528
+ {
4529
+ let populated_external_types = tcx. populated_external_types . borrow ( ) ;
4530
+ if populated_external_types. get ( ) . contains ( & type_id) {
4531
+ return
4532
+ }
4530
4533
}
4531
4534
4532
4535
csearch:: each_implementation_for_type ( tcx. sess . cstore , type_id,
@@ -4573,7 +4576,9 @@ pub fn populate_implementations_for_type_if_necessary(tcx: ctxt,
4573
4576
impls. get ( ) . insert ( implementation_def_id, implementation) ;
4574
4577
} ) ;
4575
4578
4576
- tcx. populated_external_types . insert ( type_id) ;
4579
+ let mut populated_external_types = tcx. populated_external_types
4580
+ . borrow_mut ( ) ;
4581
+ populated_external_types. get ( ) . insert ( type_id) ;
4577
4582
}
4578
4583
4579
4584
/// Populates the type context with all the implementations for the given
0 commit comments