@@ -338,7 +338,7 @@ struct ctxt_ {
338
338
// Maps a def_id of a type to a list of its inherent impls.
339
339
// Contains implementations of methods that are inherent to a type.
340
340
// Methods in these implementations don't need to be exported.
341
- inherent_impls : RefCell < HashMap < ast:: DefId , @mut ~[ @Impl ] > > ,
341
+ inherent_impls : RefCell < HashMap < ast:: DefId , @RefCell < ~[ @Impl ] > > > ,
342
342
343
343
// Maps a def_id of an impl to an Impl structure.
344
344
// Note that this contains all of the impls that we know about,
@@ -4561,14 +4561,18 @@ pub fn populate_implementations_for_type_if_necessary(tcx: ctxt,
4561
4561
let mut inherent_impls = tcx. inherent_impls . borrow_mut ( ) ;
4562
4562
match inherent_impls. get ( ) . find ( & type_id) {
4563
4563
None => {
4564
- implementation_list = @mut ~[ ] ;
4564
+ implementation_list = @RefCell :: new ( ~[ ] ) ;
4565
4565
inherent_impls. get ( ) . insert ( type_id, implementation_list) ;
4566
4566
}
4567
4567
Some ( & existing_implementation_list) => {
4568
4568
implementation_list = existing_implementation_list;
4569
4569
}
4570
4570
}
4571
- implementation_list. push ( implementation) ;
4571
+ {
4572
+ let mut implementation_list =
4573
+ implementation_list. borrow_mut ( ) ;
4574
+ implementation_list. get ( ) . push ( implementation) ;
4575
+ }
4572
4576
}
4573
4577
4574
4578
// Store the implementation info.
0 commit comments