Skip to content

trait solver: Track canonical response universe assumptions - #159987

Open
Dnreikronos wants to merge 1 commit into
rust-lang:mainfrom
Dnreikronos:trait_solver/canonical_response_assumptions
Open

trait solver: Track canonical response universe assumptions#159987
Dnreikronos wants to merge 1 commit into
rust-lang:mainfrom
Dnreikronos:trait_solver/canonical_response_assumptions

Conversation

@Dnreikronos

@Dnreikronos Dnreikronos commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #159889

Canonical responses recreate universes for placeholders created while evaluating a query. Region constraints are handled inside the query, but opaque type constraints can still carry those placeholders back to the caller. Without an assumptions entry, eager placeholder handling hits the unwrap() in get_placeholder_assumptions.

Record empty assumptions when recreating response universes under -Zassumptions-on-binders. idk if empty assumptions is the final shape irl, but imo keeping this next to create_next_universe is the right local fix. It restores the invariant where the universe enters the caller and matches bookkeeping from other binder entry paths. fyi the issue repro now reports E0277 instead of ICEing.

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 27, 2026
@rustbot

rustbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

r? @nnethercote

rustbot has assigned @nnethercote.
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 74 candidates
  • Random selection from 16 candidates

@rustbot

This comment has been minimized.

@Dnreikronos
Dnreikronos force-pushed the trait_solver/canonical_response_assumptions branch from 8402992 to 53bab87 Compare July 27, 2026 01:53
@rust-log-analyzer

This comment has been minimized.

@Dnreikronos
Dnreikronos marked this pull request as draft July 27, 2026 02:00
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 27, 2026
Canonical responses can return query-created placeholders through opaque type constraints. Record empty assumptions when recreating those universes in the caller so eager placeholder handling does not ICE.
@Dnreikronos
Dnreikronos force-pushed the trait_solver/canonical_response_assumptions branch from 53bab87 to 698320c Compare July 27, 2026 02:01
@Dnreikronos
Dnreikronos marked this pull request as ready for review July 27, 2026 11:56
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 27, 2026
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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: assumptions on binders: None context.rs

4 participants