@@ -48,7 +48,7 @@ pub struct MoveData {
48
48
/// Assignments to a path, like `x.f = foo`. These are not
49
49
/// assigned dataflow bits, but we track them because they still
50
50
/// kill move bits.
51
- path_assignments : ~[ Assignment ] ,
51
+ path_assignments : RefCell < ~[ Assignment ] > ,
52
52
assignee_ids : HashSet < ast:: NodeId > ,
53
53
}
54
54
@@ -168,7 +168,7 @@ impl MoveData {
168
168
paths : RefCell :: new ( ~[ ] ) ,
169
169
path_map : RefCell :: new ( HashMap :: new ( ) ) ,
170
170
moves : RefCell :: new ( ~[ ] ) ,
171
- path_assignments : ~[ ] ,
171
+ path_assignments : RefCell :: new ( ~[ ] ) ,
172
172
var_assignments : ~[ ] ,
173
173
assignee_ids : HashSet :: new ( ) ,
174
174
}
@@ -412,7 +412,10 @@ impl MoveData {
412
412
debug ! ( "add_assignment[path](lp={}, path_index={:?})" ,
413
413
lp. repr( tcx) , path_index) ;
414
414
415
- self . path_assignments . push ( assignment) ;
415
+ {
416
+ let mut path_assignments = self . path_assignments . borrow_mut ( ) ;
417
+ path_assignments. get ( ) . push ( assignment) ;
418
+ }
416
419
}
417
420
}
418
421
@@ -440,8 +443,11 @@ impl MoveData {
440
443
self . kill_moves ( assignment. path , assignment. id , dfcx_moves) ;
441
444
}
442
445
443
- for assignment in self . path_assignments . iter ( ) {
444
- self . kill_moves ( assignment. path , assignment. id , dfcx_moves) ;
446
+ {
447
+ let path_assignments = self . path_assignments . borrow ( ) ;
448
+ for assignment in path_assignments. get ( ) . iter ( ) {
449
+ self . kill_moves ( assignment. path , assignment. id , dfcx_moves) ;
450
+ }
445
451
}
446
452
447
453
// Kill all moves related to a variable `x` when it goes out
0 commit comments