Improve diagnostics for ambiguous binops with as _#156591
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
cc @mqudsi |
I not sure what you mean here, we are reusing existing |
|
github acting slow as usual -- the updates is yet to be processed |
Been checking the past 2 hours, but still seems to show nothing new... :( |
30e4f90 to
daf9b2e
Compare
It was a git cache issue 😪 |
daf9b2e to
c401e16
Compare
c401e16 to
af30177
Compare
|
@qaijuang Please reread my review comments (which you marked resolved) and try to implement my suggestions. |
View all comments
Fixes #156004
as _inside the RHS of an overloaded binary operation can leave the cast target unresolved while there is still a pending operator obligation that knows the more useful ambiguity.This PR keeps the normal resolved-cast path unchanged, such that when the cast target is still a type variable, cast checking now looks for a pending
BinOpobligation whose RHS contains the cast span and replays that obligation in a fresh diagnostic fulfillment context. If the replayed obligation is actually ambiguous, rustc reports the existing fulfillment ambiguity, including the competing impl candidates.Best reviewed commit-by-commit.