File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ struct ctxt_ {
330
330
destructor_for_type : RefCell < HashMap < ast:: DefId , ast:: DefId > > ,
331
331
332
332
// A method will be in this list if and only if it is a destructor.
333
- destructors : @ mut HashSet < ast:: DefId > ,
333
+ destructors : RefCell < HashSet < ast:: DefId > > ,
334
334
335
335
// Maps a trait onto a list of impls of that trait.
336
336
trait_impls : @mut HashMap < ast:: DefId , @mut ~[ @Impl ] > ,
@@ -1004,7 +1004,7 @@ pub fn mk_ctxt(s: session::Session,
1004
1004
provided_method_sources : RefCell :: new ( HashMap :: new ( ) ) ,
1005
1005
supertraits : RefCell :: new ( HashMap :: new ( ) ) ,
1006
1006
destructor_for_type : RefCell :: new ( HashMap :: new ( ) ) ,
1007
- destructors : @ mut HashSet :: new ( ) ,
1007
+ destructors : RefCell :: new ( HashSet :: new ( ) ) ,
1008
1008
trait_impls : @mut HashMap :: new ( ) ,
1009
1009
inherent_impls : @mut HashMap :: new ( ) ,
1010
1010
impls : @mut HashMap :: new ( ) ,
Original file line number Diff line number Diff line change @@ -1151,7 +1151,8 @@ impl<'a> LookupContext<'a> {
1151
1151
let bad;
1152
1152
match candidate. origin {
1153
1153
method_static( method_id) => {
1154
- bad = self . tcx ( ) . destructors . contains ( & method_id) ;
1154
+ let destructors = self . tcx ( ) . destructors . borrow ( ) ;
1155
+ bad = destructors. get ( ) . contains ( & method_id) ;
1155
1156
}
1156
1157
// XXX: does this properly enforce this on everything now
1157
1158
// that self has been merged in? -sully
Original file line number Diff line number Diff line change @@ -709,7 +709,8 @@ impl CoherenceChecker {
709
709
. borrow_mut ( ) ;
710
710
destructor_for_type. get ( ) . insert ( type_def_id,
711
711
method_def_id) ;
712
- tcx. destructors . insert ( method_def_id) ;
712
+ let mut destructors = tcx. destructors . borrow_mut ( ) ;
713
+ destructors. get ( ) . insert ( method_def_id) ;
713
714
}
714
715
_ => {
715
716
// Destructors only work on nominal types.
You can’t perform that action at this time.
0 commit comments