Skip to content

Commit 9a962a7

Browse files
author
Jorge Aparicio
committed
Tell trans that user unops are by value
1 parent c5b6d94 commit 9a962a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_trans/trans/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,11 +1101,11 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
11011101
vec![(rhs_datum, rhs.id)], Some(dest),
11021102
!ast_util::is_by_value_binop(op)).bcx
11031103
}
1104-
ast::ExprUnary(_, ref subexpr) => {
1104+
ast::ExprUnary(op, ref subexpr) => {
11051105
// if not overloaded, would be RvalueDatumExpr
11061106
let arg = unpack_datum!(bcx, trans(bcx, &**subexpr));
11071107
trans_overloaded_op(bcx, expr, MethodCall::expr(expr.id),
1108-
arg, Vec::new(), Some(dest), true).bcx
1108+
arg, Vec::new(), Some(dest), !ast_util::is_by_value_unop(op)).bcx
11091109
}
11101110
ast::ExprIndex(ref base, ref idx) => {
11111111
// if not overloaded, would be RvalueDatumExpr

0 commit comments

Comments
 (0)