trait_selection: fix assumptions-on-binders diagnostics#158588
trait_selection: fix assumptions-on-binders diagnostics#158588Dnreikronos wants to merge 1 commit into
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
6d112e4 to
36f4d5a
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
r? types |
|
r? BoxyUwU We intend to fully rework the way these diagnostics work and the errors are currently intentionally bad as they don't even have span information (they point to the whole containing function). I think keeping the status quo is preferable as a very explicit "this is still very WIP" and would personally prefer to close this PR |
|
|
thanks, that makes sense. i was mostly looking at this as remove the placeholder text, but imo you're right that the nicer message is a bit misleading if the span is still basically wrong. i'll wait for boxyuwu's opinion before closing the pr. if i poke at this again later, i think i'd rather start by carrying more of the failed outlives predicate / binder info through first, then make the diagnostic nicer once it has enough data to not lie. |
fixes #157732
the assumptions-on-binders outlives paths were still emitting placeholder text (
:3andmeoow :c), and the ui tests blessed it. imo the small, honest diagnostic is better here than trying to guess a source-level fix while the flag is still wip.this adds an explicit outlives fulfillment error for the flag, uses
higher-ranked lifetime bound could not be satisfiedacross trait selection, region reporting, and borrowck, and updates the ui output incl. the new regression test.future work, maybe: carry the failed outlives predicate or originating binder through this path so the diagnostic can name what failed. idk that it's sound for this pr; it needs more data than these callers have rn.