Skip to content

Commit

Permalink
Fix reformatting rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Dec 23, 2019
1 parent 9a60224 commit 9e50813
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/librustc_typeck/check/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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(),
}
Expand All @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e50813

Please sign in to comment.