-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid type-checking addition and indexing twice. #40863
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit 112f36a has been approved by |
@bors r- Travis failed (I'll investigate later) |
Accepting for beta, once @eddyb fixes travis failures. Small patch, regression. cc @rust-lang/compiler |
I suspect there's another bug elsewhere but at least I hope I can make this work. |
@@ -257,9 +262,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { | |||
} | |||
}; | |||
|
|||
// see `NB` above | |||
self.check_expr_coercable_to_type(rhs_expr, rhs_ty_var); | |||
|
|||
(rhs_ty_var, return_ty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests weren't passing locally (actually, libcollections
wasn't building at all after a rebase) when rhs_ty_var
was replaced with rhs_ty
.
@bors r=arielb1 |
📌 Commit edc7f9a has been approved by |
cc @alexcrichton This should be ready for backport now, apologies for the delay. |
⌛ Testing commit edc7f9a with merge 50c1864... |
☀️ Test successful - status-appveyor, status-travis |
Fixes #40610 by moving the common
check_expr_coercable_to_type
call before the error reporting logic for binops and removing the one fromcheck_str_addition
.Fixes #40861 by removing an unnecessary
check_expr_coercable_to_type
call.