@@ -290,7 +290,7 @@ struct ctxt_ {
290
290
methods : RefCell < HashMap < DefId , @Method > > ,
291
291
292
292
// Maps from a trait def-id to a list of the def-ids of its methods
293
- trait_method_def_ids : @ mut HashMap < DefId , @~[ DefId ] > ,
293
+ trait_method_def_ids : RefCell < HashMap < DefId , @~[ DefId ] > > ,
294
294
295
295
// A cache for the trait_methods() routine
296
296
trait_methods_cache : @mut HashMap < DefId , @~[ @Method ] > ,
@@ -999,7 +999,7 @@ pub fn mk_ctxt(s: session::Session,
999
999
ast_ty_to_ty_cache : @mut HashMap :: new ( ) ,
1000
1000
enum_var_cache : @mut HashMap :: new ( ) ,
1001
1001
methods : RefCell :: new ( HashMap :: new ( ) ) ,
1002
- trait_method_def_ids : @ mut HashMap :: new ( ) ,
1002
+ trait_method_def_ids : RefCell :: new ( HashMap :: new ( ) ) ,
1003
1003
trait_methods_cache : @mut HashMap :: new ( ) ,
1004
1004
impl_trait_cache : @mut HashMap :: new ( ) ,
1005
1005
ty_param_defs : @mut HashMap :: new ( ) ,
@@ -3610,9 +3610,13 @@ pub fn method(cx: ctxt, id: ast::DefId) -> @Method {
3610
3610
}
3611
3611
3612
3612
pub fn trait_method_def_ids ( cx : ctxt , id : ast:: DefId ) -> @~[ DefId ] {
3613
- lookup_locally_or_in_crate_store (
3614
- "trait_method_def_ids" , id, cx. trait_method_def_ids ,
3615
- || @csearch:: get_trait_method_def_ids ( cx. cstore , id) )
3613
+ let mut trait_method_def_ids = cx. trait_method_def_ids . borrow_mut ( ) ;
3614
+ lookup_locally_or_in_crate_store ( "trait_method_def_ids" ,
3615
+ id,
3616
+ trait_method_def_ids. get ( ) ,
3617
+ || {
3618
+ @csearch:: get_trait_method_def_ids ( cx. cstore , id)
3619
+ } )
3616
3620
}
3617
3621
3618
3622
pub fn impl_trait_ref ( cx : ctxt , id : ast:: DefId ) -> Option < @TraitRef > {
0 commit comments