File tree Expand file tree Collapse file tree 5 files changed +11
-7
lines changed
branches/try2/src/librustc/middle Expand file tree Collapse file tree 5 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: b5b403abcc2f3a3fed2ef154f2aeffc479cfcfc2
8
+ refs/heads/try2: bc1ea7887c1815164af8b3cf301d42c2a7a0b9ab
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -419,7 +419,10 @@ impl<'a> CheckLoanCtxt<'a> {
419
419
derefs : deref_count
420
420
} ;
421
421
debug ! ( "Inserting write guard at {:?}" , key) ;
422
- this. bccx . write_guard_map . insert ( key) ;
422
+ let mut write_guard_map = this. bccx
423
+ . write_guard_map
424
+ . borrow_mut ( ) ;
425
+ write_guard_map. get ( ) . insert ( key) ;
423
426
}
424
427
425
428
_ => { }
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ pub fn check_crate(
82
82
moved_variables_set : moved_variables_set,
83
83
capture_map : capture_map,
84
84
root_map : root_map ( ) ,
85
- write_guard_map : @mut HashSet :: new ( ) ,
85
+ write_guard_map : @RefCell :: new ( HashSet :: new ( ) ) ,
86
86
stats : @mut BorrowStats {
87
87
loaned_paths_same : 0 ,
88
88
loaned_paths_imm : 0 ,
@@ -217,7 +217,7 @@ pub struct root_map_key {
217
217
218
218
// A set containing IDs of expressions of gc'd type that need to have a write
219
219
// guard.
220
- pub type write_guard_map = @mut HashSet < root_map_key > ;
220
+ pub type write_guard_map = @RefCell < HashSet < root_map_key > > ;
221
221
222
222
pub type BckResult < T > = Result < T , BckError > ;
223
223
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ pub fn lookup_variant_by_id(tcx: ty::ctxt,
123
123
root_map : @RefCell :: new ( HashMap :: new ( ) ) ,
124
124
method_map : @mut HashMap :: new ( ) ,
125
125
vtable_map : @RefCell :: new ( HashMap :: new ( ) ) ,
126
- write_guard_map : @mut HashSet :: new ( ) ,
126
+ write_guard_map : @RefCell :: new ( HashSet :: new ( ) ) ,
127
127
capture_map : @RefCell :: new ( HashMap :: new ( ) )
128
128
} ;
129
129
let e = match csearch:: maybe_get_item_ast ( tcx, enum_def,
@@ -173,7 +173,7 @@ pub fn lookup_const_by_id(tcx: ty::ctxt,
173
173
root_map : @RefCell :: new ( HashMap :: new ( ) ) ,
174
174
method_map : @mut HashMap :: new ( ) ,
175
175
vtable_map : @RefCell :: new ( HashMap :: new ( ) ) ,
176
- write_guard_map : @mut HashSet :: new ( ) ,
176
+ write_guard_map : @RefCell :: new ( HashSet :: new ( ) ) ,
177
177
capture_map : @RefCell :: new ( HashMap :: new ( ) )
178
178
} ;
179
179
let e = match csearch:: maybe_get_item_ast ( tcx, def_id,
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ pub fn root_and_write_guard(datum: &Datum,
56
56
// Perform the write guard, if necessary.
57
57
//
58
58
// (Note: write-guarded values are always boxes)
59
- if ccx. maps . write_guard_map . contains ( & key) {
59
+ let write_guard_map = ccx. maps . write_guard_map . borrow ( ) ;
60
+ if write_guard_map. get ( ) . contains ( & key) {
60
61
perform_write_guard ( datum, bcx, span)
61
62
} else {
62
63
bcx
You can’t perform that action at this time.
0 commit comments