From 5caebb23cd3b2c4c8519cc94759a7bc0a377f959 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 15 Dec 2014 16:18:17 -0500 Subject: [PATCH] Tell regionck that user unops are by value --- src/librustc_typeck/check/regionck.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index 2ec7e2c38836..bfa3c384da7b 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -682,10 +682,12 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) { visit::walk_expr(rcx, expr); } - ast::ExprUnary(_, ref lhs) if has_method_map => { + ast::ExprUnary(op, ref lhs) if has_method_map => { + let implicitly_ref_args = !ast_util::is_by_value_unop(op); + // As above. constrain_call(rcx, expr, Some(&**lhs), - None::.iter(), true); + None::.iter(), implicitly_ref_args); visit::walk_expr(rcx, expr); }