Use the MoveReason to determine a more precise MoveKind in gather_moves.

This commit is contained in:
Cameron Zwarich 2014-06-06 11:59:33 -07:00
parent 5ccb7644be
commit 40e3fb4c0b
2 changed files with 13 additions and 8 deletions

View file

@ -45,10 +45,15 @@ pub fn gather_move_from_expr(bccx: &BorrowckCtxt,
move_data: &MoveData,
move_error_collector: &MoveErrorCollector,
move_expr_id: ast::NodeId,
cmt: mc::cmt) {
cmt: mc::cmt,
move_reason: euv::MoveReason) {
let kind = match move_reason {
euv::DirectRefMove | euv::PatBindingMove => MoveExpr,
euv::CaptureMove => Captured
};
let move_info = GatherMoveInfo {
id: move_expr_id,
kind: MoveExpr,
kind: kind,
cmt: cmt,
span_path_opt: None,
};

View file

@ -75,13 +75,13 @@ impl<'a> euv::Delegate for GatherLoanCtxt<'a> {
consume_id, cmt.repr(self.tcx()), mode);
match mode {
euv::Copy => { return; }
euv::Move(_) => { }
euv::Move(move_reason) => {
gather_moves::gather_move_from_expr(
self.bccx, &self.move_data, &self.move_error_collector,
consume_id, cmt, move_reason);
}
euv::Copy => { }
}
gather_moves::gather_move_from_expr(
self.bccx, &self.move_data, &self.move_error_collector,
consume_id, cmt);
}
fn consume_pat(&mut self,