Skip to content

Commit 9e50813

Browse files
committed
Fix reformatting rebase issues
1 parent 9a60224 commit 9e50813

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/librustc_typeck/check/expr.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
220220
ExprKind::Lit(ref lit) => self.check_lit(&lit, expected),
221221
ExprKind::Binary(op, ref lhs, ref rhs) => self.check_binop(expr, op, lhs, rhs),
222222
ExprKind::Assign(ref lhs, ref rhs, ref span) => {
223-
self.check_binop_assign(expr, op, lhs, rhs)
223+
self.check_expr_assign(expr, expected, lhs, rhs, span)
224224
}
225+
ExprKind::AssignOp(op, ref lhs, ref rhs) => self.check_binop_assign(expr, op, lhs, rhs),
225226
ExprKind::Unary(unop, ref oprnd) => {
226227
self.check_expr_unary(unop, oprnd, expected, needs, expr)
227228
}
@@ -730,8 +731,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
730731
comps.iter().all(|e| self.is_destructuring_place_expr(e))
731732
}
732733
ExprKind::Struct(_path, fields, rest) => {
733-
rest.as_ref().map(|e| self.is_destructuring_place_expr(e)).unwrap_or(true) &&
734-
fields.iter().all(|f| self.is_destructuring_place_expr(&f.expr))
734+
rest.as_ref().map(|e| self.is_destructuring_place_expr(e)).unwrap_or(true)
735+
&& fields.iter().all(|f| self.is_destructuring_place_expr(&f.expr))
735736
}
736737
_ => expr.is_syntactic_place_expr(),
737738
}
@@ -752,9 +753,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
752753
err.span_label(lhs.span, "cannot assign to this expression");
753754
if self.is_destructuring_place_expr(lhs) {
754755
err.note("destructuring assignments are not currently supported");
755-
err.note(
756-
"for more information, see https://github.com/rust-lang/rfcs/issues/372",
757-
);
756+
err.note("for more information, see https://github.com/rust-lang/rfcs/issues/372");
758757
}
759758
err.emit();
760759
}

src/librustc_typeck/check/op.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2626
self.check_overloaded_binop(expr, lhs, rhs, op, IsAssign::Yes);
2727

2828
let ty =
29-
if !lhs.is_ty_var() && !rhs.is_ty_var() && is_builtin_binop(lhs, rhs, op) {
30-
self.enforce_builtin_binop_types(lhs_expr, lhs, rhs_expr, rhs, op);
29+
if !lhs_ty.is_ty_var() && !rhs_ty.is_ty_var() && is_builtin_binop(lhs_ty, rhs_ty, op) {
30+
self.enforce_builtin_binop_types(lhs, lhs_ty, rhs, rhs_ty, op);
3131
self.tcx.mk_unit()
3232
} else {
3333
return_ty

0 commit comments

Comments
 (0)