about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-12-23 12:39:48 +0000
committervarkor <github@varkor.com>2019-12-23 12:39:48 +0000
commit9e5081394cac4429de287e6c10b350f698a97f65 (patch)
treea0fb380448d6dfdc637e5537967c2c366d7cd6b1
parent9a602243c422f183f574ff53e5d3e9e85fcc1210 (diff)
downloadrust-9e5081394cac4429de287e6c10b350f698a97f65.tar.gz
rust-9e5081394cac4429de287e6c10b350f698a97f65.zip
Fix reformatting rebase issues
-rw-r--r--src/librustc_typeck/check/expr.rs11
-rw-r--r--src/librustc_typeck/check/op.rs4
2 files changed, 7 insertions, 8 deletions
diff --git a/src/librustc_typeck/check/expr.rs b/src/librustc_typeck/check/expr.rs
index 542c2b16c60..5c602ad76cd 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 dfa55e324a6..c5d3aac136b 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