Fix: WF ICE assumptions on binders - #160497
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @adwinwhite (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
aefa84f to
5b7244d
Compare
| @@ -0,0 +1,38 @@ | |||
| //@ compile-flags: -Znext-solver=globally -Zassumptions-on-binders | |||
| //@ check-pass | |||
|
|
|||
There was a problem hiding this comment.
Could you add some comments on what this test is about?
| param_env: ty::ParamEnv<'tcx>, | ||
| term: ty::Term<'tcx>, | ||
| ) -> Option<Vec<Goal<'tcx, ty::Predicate<'tcx>>>> { | ||
| let term = self.0.resolve_vars_if_possible(term); |
There was a problem hiding this comment.
We already resolve vars for goal input and normalized term in the next solver. Could you find the specific callers that forget to do this? If there're only one or two cases, we probably should fix it there instead.
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
79ad637 to
e176c84
Compare
|
@rustbot review |
|
I think we should look into the callers of |
I think the only caller of
The fix resolves them in Let me know if I'm overlooking something here. |
How so? |
Sorry.. you're right, I only checked And yes, there are 6 callers that could trigger this pattern, but fixing at every caller would be fragile. The visitor-level resolve matches the convention: callers of |
|
Convention is different in the next solver. We do not expect random unresolved vars here. |
e176c84 to
94dc630
Compare
|
Those Sorry for being pedantic over this. It's totally fine if you don't want to dig further and we can merge the original fix with a FIXME that we didn't find the source of the unresolved vars. |
thanks for the direction!! i’d like to dig into this a bit further. i’ll try to trace where the |
|
@adwinwhite, i did some tracing. the principal eq in the i'll add this explanation to the |
|
👍 Good job. We don't need the FIXME then. Just keep current fix and add comments on I think we should add a debug_assert |
94dc630 to
d430a5c
Compare
e1a620e to
d918d13
Compare
|
☔ The latest upstream changes (presumably #161093) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Fixes #160293
-Zassumptions-on-bindersICEs because the solver'swell_formed_goalspasses terms with resolvable inference variables tounnormalized_obligations, which asserts they're already resolved (unlike other callers).Resolve inference variables before computing WF obligations.