Skip to content

Commit

Permalink
(For legacy code:) In liveness, require that by-move arguments are rv…
Browse files Browse the repository at this point in the history
…alues
  • Loading branch information
catamorphism committed Oct 13, 2012
1 parent 632d606 commit 9abc7f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,15 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) {
match ty::resolved_mode(self.tcx, arg_ty.mode) {
by_val | by_copy | by_ref => {}
by_move => {
self.check_move_from_expr(*arg_expr, vt);
if ty::expr_is_lval(self.tcx, self.ir.method_map,
*arg_expr) {
// Probably a bad error message (what's an rvalue?)
// but I can't think of anything better
self.tcx.sess.span_err(arg_expr.span,
#fmt("Move mode argument must be an rvalue: try \
(move %s) instead", expr_to_str(*arg_expr,
self.tcx.sess.intr())));
}
}
}
}
Expand Down

0 comments on commit 9abc7f0

Please sign in to comment.