@@ -338,7 +338,7 @@ struct ctxt_ {
338338 // Maps a def_id of a type to a list of its inherent impls.
339339 // Contains implementations of methods that are inherent to a type.
340340 // 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 ] > > > ,
342342
343343 // Maps a def_id of an impl to an Impl structure.
344344 // 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,
45614561 let mut inherent_impls = tcx. inherent_impls . borrow_mut ( ) ;
45624562 match inherent_impls. get ( ) . find ( & type_id) {
45634563 None => {
4564- implementation_list = @mut ~[ ] ;
4564+ implementation_list = @RefCell :: new ( ~[ ] ) ;
45654565 inherent_impls. get ( ) . insert ( type_id, implementation_list) ;
45664566 }
45674567 Some ( & existing_implementation_list) => {
45684568 implementation_list = existing_implementation_list;
45694569 }
45704570 }
4571- implementation_list. push ( implementation) ;
4571+ {
4572+ let mut implementation_list =
4573+ implementation_list. borrow_mut ( ) ;
4574+ implementation_list. get ( ) . push ( implementation) ;
4575+ }
45724576 }
45734577
45744578 // Store the implementation info.
0 commit comments