From 9e5081394cac4429de287e6c10b350f698a97f65 Mon Sep 17 00:00:00 2001 From: varkor Date: Mon, 23 Dec 2019 12:39:48 +0000 Subject: [PATCH] Fix reformatting rebase issues --- src/librustc_typeck/check/expr.rs | 11 +++++------ src/librustc_typeck/check/op.rs | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/librustc_typeck/check/expr.rs b/src/librustc_typeck/check/expr.rs index 542c2b16c602e..5c602ad76cd32 100644 --- a/src/librustc_typeck/check/expr.rs +++ b/src/librustc_typeck/check/expr.rs @@ -220,8 +220,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ExprKind::Lit(ref lit) => self.check_lit(&lit, expected), ExprKind::Binary(op, ref lhs, ref rhs) => self.check_binop(expr, op, lhs, rhs), ExprKind::Assign(ref lhs, ref rhs, ref span) => { - self.check_binop_assign(expr, op, lhs, rhs) + self.check_expr_assign(expr, expected, lhs, rhs, span) } + ExprKind::AssignOp(op, ref lhs, ref rhs) => self.check_binop_assign(expr, op, lhs, rhs), ExprKind::Unary(unop, ref oprnd) => { self.check_expr_unary(unop, oprnd, expected, needs, expr) } @@ -730,8 +731,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { comps.iter().all(|e| self.is_destructuring_place_expr(e)) } ExprKind::Struct(_path, fields, rest) => { - rest.as_ref().map(|e| self.is_destructuring_place_expr(e)).unwrap_or(true) && - fields.iter().all(|f| self.is_destructuring_place_expr(&f.expr)) + rest.as_ref().map(|e| self.is_destructuring_place_expr(e)).unwrap_or(true) + && fields.iter().all(|f| self.is_destructuring_place_expr(&f.expr)) } _ => expr.is_syntactic_place_expr(), } @@ -752,9 +753,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err.span_label(lhs.span, "cannot assign to this expression"); if self.is_destructuring_place_expr(lhs) { err.note("destructuring assignments are not currently supported"); - err.note( - "for more information, see https://github.com/rust-lang/rfcs/issues/372", - ); + err.note("for more information, see https://github.com/rust-lang/rfcs/issues/372"); } err.emit(); } diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index dfa55e324a625..c5d3aac136bcb 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -26,8 +26,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { self.check_overloaded_binop(expr, lhs, rhs, op, IsAssign::Yes); let ty = - if !lhs.is_ty_var() && !rhs.is_ty_var() && is_builtin_binop(lhs, rhs, op) { - self.enforce_builtin_binop_types(lhs_expr, lhs, rhs_expr, rhs, op); + if !lhs_ty.is_ty_var() && !rhs_ty.is_ty_var() && is_builtin_binop(lhs_ty, rhs_ty, op) { + self.enforce_builtin_binop_types(lhs, lhs_ty, rhs, rhs_ty, op); self.tcx.mk_unit() } else { return_ty