trait_solver: Reject canonical responses with placeholder universe leaks - #160955
Open
Dnreikronos wants to merge 5 commits into
Open
trait_solver: Reject canonical responses with placeholder universe leaks#160955Dnreikronos wants to merge 5 commits into
Dnreikronos wants to merge 5 commits into
Conversation
Cover opaque returns of `impl for<T> Trait<T>` under -Zassumptions-on-binders so proof-tree replay no longer ICEs on placeholder universe mismatches.
Proof-tree visitors previously treated instantiate_nested_goals failure as a successful visit via VisitorResult::output(), which is Continue for ControlFlow. CoerceVisitor must Break instead so coerce_unsized rejects inapplicable candidate replay rather than treating it as a valid unsizing path.
Collaborator
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
Collaborator
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
|
r? types |
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
r? @BoxyUwU for assumptions on binders stuff |
Collaborator
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #160802
-Zassumptions-on-bindersplus animpl for<T> Trait<T>RPIT was ICEing in proof-tree replay whenunify_query_var_valueshit.unwrap()on a Sorts error for the same binder placeholder living in two universes. Imo that unwrap was always a bit cursed on the diagnostics path, idk why we kept trusting it this long.Canonical response/state apply is fallible now and turns those leaks into
NoSolutioninstead of panicking. Region-only placeholders don't block valid region lowering. Also madeCoerceVisitorBreak when nested candidate replay fails, since Continue was treating a failed instantiate as "unsizing ok" (btwVisitorResult::outputis Continue forControlFlow, easy to miss). Added the issue repro plus a few universe-leak regressions.Fyi the
prev_universeproof-tree fix is already on main and I kept it. Irl I'd rather get this in asap than bike-shed the diagnostics wording further, but ltm if you'd rather the failed replay surface louder than a quietNoSolution.