Skip to content

Yeet propagate_ambiguity - #162935

Open
adwinwhite wants to merge 4 commits into
rust-lang:mainfrom
adwinwhite:abby-ambig
Open

adwinwhite wants to merge 4 commits into
rust-lang:mainfrom
adwinwhite:abby-ambig

Conversation

@adwinwhite

@adwinwhite adwinwhite commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes rust-lang/project-assumptions-on-binders#29

When assumptions computation fails, we want to force the goal response to be ambiguous since we can't evaluate placeholder constraints.
We used to do this via LeafRegionConstraint::Ambiguity and propagates it everywhere.

This PR simplifies that by tracking whether we should force ambiguity in a more direct way. We just check whether we have computed assumptions for relevant universes.
This also clarifies the meaning of LeafRegionConstraint::Ambiguity which only represents true ambiguity (forever ambiguity no matter inference progress).

This doesn't solve the problem that we're being conservative about forcing ambiguity. Maybe we can have falses in some universes even if other universes don't have assumptions. We can be smart about this in the future.

Unsure part: we can also have ambiguity from non-lifetime placeholder. Unsure what to do with that. Still trying to understand it.

r? @BoxyUwU

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 Sep 18, 2026
@rustbot

rustbot commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

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

@rust-log-analyzer

This comment has been minimized.

@adwinwhite
adwinwhite marked this pull request as ready for review September 18, 2026 06:48
@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 Sep 18, 2026
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU BoxyUwU left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sick! this looks right to me :3 thanks

View changes since this review


let constraint = ((smallest_universe + 1)..=largest_universe)
.map(|u| UniverseIndex::from_usize(u))
if !self

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining why we use ambiguity here

@BoxyUwU

BoxyUwU commented Sep 23, 2026

Copy link
Copy Markdown
Member

@rustbot author

@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 Sep 23, 2026
@rustbot

rustbot commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rust-bors

rust-bors Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #163227) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

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-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

ambiguity handling is weird

4 participants