Repository navigation
trait solver: Resolve region vars before eager placeholder handling - #164103
Dnreikronos wants to merge 3 commits into
Conversation
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
|
r? @davidtwco rustbot has assigned @davidtwco. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @BoxyUwU |
|
|
This comment was marked as outdated.
This comment was marked as outdated.
|
@rustbot author thanks for splitting this out, and good job on the test DSL changes :3 |
|
Reminder, once the PR becomes ready for a review, use |
…egion_vars, r=BoxyUwU trait solver: Resolve region vars before eager placeholder handling Region vars can already have known values in the unification table while the stored constraint still contains the vars. `max_universe` looks through the table, but `PlaceholderReplacer` sees the stored terms. In Boxy's nested binder case, that leaves an alias constraint ambiguous even after equating its regions. I used `deeply_resolve_via_unification_table` at the start of eager handling for each universe. That leaves only the current universe's placeholder to bind and lets the result match the actual assumption on the outer binder. Unknown vars stay unknown. The test DSL needed a small equality operation, `'a2 = 'a`, to reach this state. The paired outlives constraints in the original example go straight into solver storage and don't populate the table on current main. I kept that example as an ambiguity control and added the version with real table equalities, plus a chained-var case. Both adjusted cases fail when the resolution call is removed and pass with it. I think keeping this separate makes rust-lang#157984 easier to review. The broader equality and subtyping work stays there.
…egion_vars, r=BoxyUwU trait solver: Resolve region vars before eager placeholder handling Region vars can already have known values in the unification table while the stored constraint still contains the vars. `max_universe` looks through the table, but `PlaceholderReplacer` sees the stored terms. In Boxy's nested binder case, that leaves an alias constraint ambiguous even after equating its regions. I used `deeply_resolve_via_unification_table` at the start of eager handling for each universe. That leaves only the current universe's placeholder to bind and lets the result match the actual assumption on the outer binder. Unknown vars stay unknown. The test DSL needed a small equality operation, `'a2 = 'a`, to reach this state. The paired outlives constraints in the original example go straight into solver storage and don't populate the table on current main. I kept that example as an ambiguity control and added the version with real table equalities, plus a chained-var case. Both adjusted cases fail when the resolution call is removed and pass with it. I think keeping this separate makes rust-lang#157984 easier to review. The broader equality and subtyping work stays there.
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #164212 (comment) |
|
This pull request was unapproved. This PR was contained in a rollup (#164212), which was unapproved. |
|
@BoxyUwU @JonathanBrouwer I removed the ambiguity control and pushed a follow-up after checking the bors failure. It expected ambiguity from unresolved region vars, but #164045 now turns those vars into bound vars and produces concrete alias constraints, so that expectation no longer holds. I originally kept the paired outlives example because those constraints don't populate the unification table, which helped explain why the DSL needed explicit equality. Looking at the failure, though, that control was also depending on the old handling of unresolved vars. I think removing it makes sense here and keeps the tests focused on resolving values already known in the table. The compiler change stays as it is. I kept the equality and chained-variable tests, including their exact intermediate expectations, and both passed in the failed rollup. |
Region vars can already have known values in the unification table while the stored constraint still contains the vars.
max_universelooks through the table, butPlaceholderReplacersees the stored terms. In Boxy's nested binder case, that leaves an alias constraint ambiguous even after equating its regions.I used
deeply_resolve_via_unification_tableat the start of eager handling for each universe. That leaves only the current universe's placeholder to bind and lets the result match the actual assumption on the outer binder. Unknown vars stay unknown.The test DSL needed a small equality operation,
'a2 = 'a, to reach this state. The paired outlives constraints in the original example go straight into solver storage and don't populate the table on current main. I added the version with real table equalities, plus a chained-var case. Both adjusted cases fail when the resolution call is removed and pass with it.I think keeping this separate makes #157984 easier to review. The broader equality and subtyping work stays there.