Skip to content

Commit 1b06a95

Browse files
committed
librustc: De-@mut MoveData::assignee_ids
1 parent 111e167 commit 1b06a95

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/librustc/middle/borrowck/move_data.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct MoveData {
4949
/// assigned dataflow bits, but we track them because they still
5050
/// kill move bits.
5151
path_assignments: RefCell<~[Assignment]>,
52-
assignee_ids: HashSet<ast::NodeId>,
52+
assignee_ids: RefCell<HashSet<ast::NodeId>>,
5353
}
5454

5555
pub struct FlowedMoveData {
@@ -170,7 +170,7 @@ impl MoveData {
170170
moves: RefCell::new(~[]),
171171
path_assignments: RefCell::new(~[]),
172172
var_assignments: RefCell::new(~[]),
173-
assignee_ids: HashSet::new(),
173+
assignee_ids: RefCell::new(HashSet::new()),
174174
}
175175
}
176176

@@ -395,7 +395,10 @@ impl MoveData {
395395

396396
let path_index = self.move_path(tcx, lp);
397397

398-
self.assignee_ids.insert(assignee_id);
398+
{
399+
let mut assignee_ids = self.assignee_ids.borrow_mut();
400+
assignee_ids.get().insert(assignee_id);
401+
}
399402

400403
let assignment = Assignment {
401404
path: path_index,
@@ -666,7 +669,8 @@ impl FlowedMoveData {
666669
-> bool {
667670
//! True if `id` is the id of the LHS of an assignment
668671
669-
self.move_data.assignee_ids.iter().any(|x| x == &id)
672+
let assignee_ids = self.move_data.assignee_ids.borrow();
673+
assignee_ids.get().iter().any(|x| x == &id)
670674
}
671675

672676
pub fn each_assignment_of(&self,

0 commit comments

Comments
 (0)