File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1006,7 +1006,7 @@ pub fn mk_ctxt(s: session::Session,
1006
1006
impls : RefCell :: new ( HashMap :: new ( ) ) ,
1007
1007
used_unsafe : @mut HashSet :: new ( ) ,
1008
1008
used_mut_nodes : @mut HashSet :: new ( ) ,
1009
- impl_vtables : @ mut HashMap :: new ( ) ,
1009
+ impl_vtables : RefCell :: new ( HashMap :: new ( ) ) ,
1010
1010
populated_external_types : @mut HashSet :: new ( ) ,
1011
1011
populated_external_traits : @mut HashSet :: new ( ) ,
1012
1012
@@ -3980,8 +3980,9 @@ pub fn lookup_item_type(cx: ctxt,
3980
3980
pub fn lookup_impl_vtables ( cx : ctxt ,
3981
3981
did : ast:: DefId )
3982
3982
-> typeck:: impl_res {
3983
+ let mut impl_vtables = cx. impl_vtables . borrow_mut ( ) ;
3983
3984
lookup_locally_or_in_crate_store (
3984
- "impl_vtables" , did, cx . impl_vtables ,
3985
+ "impl_vtables" , did, impl_vtables. get ( ) ,
3985
3986
|| csearch:: get_impl_vtables ( cx, did) )
3986
3987
}
3987
3988
Original file line number Diff line number Diff line change @@ -778,7 +778,9 @@ pub fn resolve_impl(ccx: @mut CrateCtxt,
778
778
self_vtables : self_vtable_res
779
779
} ;
780
780
let impl_def_id = ast_util:: local_def ( impl_item. id ) ;
781
- ccx. tcx . impl_vtables . insert ( impl_def_id, res) ;
781
+
782
+ let mut impl_vtables = ccx. tcx . impl_vtables . borrow_mut ( ) ;
783
+ impl_vtables. get ( ) . insert ( impl_def_id, res) ;
782
784
}
783
785
784
786
impl visit:: Visitor < ( ) > for @FnCtxt {
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ use util::common::time;
68
68
use util:: ppaux:: Repr ;
69
69
use util:: ppaux;
70
70
71
+ use std:: cell:: RefCell ;
71
72
use std:: hashmap:: HashMap ;
72
73
use std:: result;
73
74
use extra:: list:: List ;
@@ -225,7 +226,7 @@ impl Repr for impl_res {
225
226
}
226
227
}
227
228
228
- pub type impl_vtable_map = @ mut HashMap < ast:: DefId , impl_res > ;
229
+ pub type impl_vtable_map = RefCell < HashMap < ast:: DefId , impl_res > > ;
229
230
230
231
pub struct CrateCtxt {
231
232
// A mapping from method call sites to traits that have that method.
You can’t perform that action at this time.
0 commit comments