From 1b06a9593fe1d1ec8d1f54efcdc57689907df942 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sat, 21 Dec 2013 18:58:54 -0800 Subject: [PATCH] librustc: De-`@mut` `MoveData::assignee_ids` --- src/librustc/middle/borrowck/move_data.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/librustc/middle/borrowck/move_data.rs b/src/librustc/middle/borrowck/move_data.rs index 0a1ad19468ef..2690038d8e27 100644 --- a/src/librustc/middle/borrowck/move_data.rs +++ b/src/librustc/middle/borrowck/move_data.rs @@ -49,7 +49,7 @@ pub struct MoveData { /// assigned dataflow bits, but we track them because they still /// kill move bits. path_assignments: RefCell<~[Assignment]>, - assignee_ids: HashSet, + assignee_ids: RefCell>, } pub struct FlowedMoveData { @@ -170,7 +170,7 @@ impl MoveData { moves: RefCell::new(~[]), path_assignments: RefCell::new(~[]), var_assignments: RefCell::new(~[]), - assignee_ids: HashSet::new(), + assignee_ids: RefCell::new(HashSet::new()), } } @@ -395,7 +395,10 @@ impl MoveData { let path_index = self.move_path(tcx, lp); - self.assignee_ids.insert(assignee_id); + { + let mut assignee_ids = self.assignee_ids.borrow_mut(); + assignee_ids.get().insert(assignee_id); + } let assignment = Assignment { path: path_index, @@ -666,7 +669,8 @@ impl FlowedMoveData { -> bool { //! True if `id` is the id of the LHS of an assignment - self.move_data.assignee_ids.iter().any(|x| x == &id) + let assignee_ids = self.move_data.assignee_ids.borrow(); + assignee_ids.get().iter().any(|x| x == &id) } pub fn each_assignment_of(&self,