From 9a962a7bdc9a794fbaa1e96ae951c22dd31eac86 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 15 Dec 2014 16:14:25 -0500 Subject: [PATCH] Tell trans that user unops are by value --- src/librustc_trans/trans/expr.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index 690e7cf81f5..304142453a9 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -1101,11 +1101,11 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, vec![(rhs_datum, rhs.id)], Some(dest), !ast_util::is_by_value_binop(op)).bcx } - ast::ExprUnary(_, ref subexpr) => { + ast::ExprUnary(op, ref subexpr) => { // if not overloaded, would be RvalueDatumExpr let arg = unpack_datum!(bcx, trans(bcx, &**subexpr)); trans_overloaded_op(bcx, expr, MethodCall::expr(expr.id), - arg, Vec::new(), Some(dest), true).bcx + arg, Vec::new(), Some(dest), !ast_util::is_by_value_unop(op)).bcx } ast::ExprIndex(ref base, ref idx) => { // if not overloaded, would be RvalueDatumExpr