Skip to content

trait solver: Resolve region vars before eager placeholder handling - #164103

Open
Dnreikronos wants to merge 2 commits into
rust-lang:mainfrom
Dnreikronos:trait_solver_resolve_region_vars
Open

Dnreikronos wants to merge 2 commits into
rust-lang:mainfrom
Dnreikronos:trait_solver_resolve_region_vars

Conversation

@Dnreikronos

@Dnreikronos Dnreikronos commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

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 #157984 easier to review. The broader equality and subtyping work stays there.

@rustbot

rustbot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 10, 2026
@rustbot

rustbot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 18 candidates

@Dnreikronos

Copy link
Copy Markdown
Contributor Author

r? @BoxyUwU

@rustbot rustbot assigned BoxyUwU and unassigned davidtwco Oct 10, 2026
@rustbot

rustbot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants