Skip to content
Permalink
Browse files

Fix reformatting rebase issues

  • Loading branch information
varkor committed Dec 23, 2019
1 parent 9a60224 commit 9e5081394cac4429de287e6c10b350f698a97f65
Showing with 7 additions and 8 deletions.
  1. +5 −6 src/librustc_typeck/check/expr.rs
  2. +2 −2 src/librustc_typeck/check/op.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();
}
@@ -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

0 comments on commit 9e50813

Please sign in to comment.
You can’t perform that action at this time.