提交 40e3fb4c 编写于 作者: C Cameron Zwarich

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

上级 5ccb7644
......@@ -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,
};
......
......@@ -75,13 +75,13 @@ fn consume(&mut self,
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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册