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. |
| // 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.
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_typecall before the error reporting logic for binops and removing the one fromcheck_str_addition.Fixes #40861 by removing an unnecessary
check_expr_coercable_to_typecall.