Skip to content

don't ignore ambiguity during MIR type check - #164055

Open
lcnr wants to merge 2 commits into
rust-lang:mainfrom
lcnr:next-solver-soundness-bug
Open

lcnr wants to merge 2 commits into
rust-lang:mainfrom
lcnr:next-solver-soundness-bug

Conversation

@lcnr

@lcnr lcnr commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

fixes #164054

this was previously fixed in #116530 and later reverted in #118736.

It impacts the new solver more than the old one as the new solver depends significantly more on region identity, see the relevant stabilization report section.

The old solver has significantly less region identity dependence. It does rely on region identity when merging candidates during normalization:

// Duplicates can happen inside ParamEnv. In the case, we
// perform a lazy deduplication.
if current == &candidate {
return false;
}

This check results in additional ICE with the old solver while instead triggering the potentially region dependent goals check with the new one

let value = op(&ocx).map_err(|_| {
infcx.tcx.check_potentially_region_dependent_goals(root_def_id).err().unwrap_or_else(

r? types

@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 Oct 9, 2026
@lcnr lcnr added the I-types-nominated Nominated for discussion during a types team meeting. label Oct 9, 2026
@rustbot

rustbot commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

🤖 A dedicated #t-types/nominated topic has been opened for humans to discuss this issue 🤖

@rust-log-analyzer

This comment has been minimized.

@lcnr lcnr closed this Oct 9, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 9, 2026
@lcnr lcnr reopened this Oct 9, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 9, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@lcnr
lcnr force-pushed the next-solver-soundness-bug branch from 3eee062 to d5ef0a9 Compare October 28, 2026 14:43
@rustbot

rustbot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@lcnr lcnr removed the I-types-nominated Nominated for discussion during a types team meeting. label Oct 28, 2026
@rustbot

rustbot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

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.

@@ -1,7 +1,10 @@
// Test for <https://github.com/rust-lang/rust/issues/135316>.

@RalfJung RalfJung Oct 28, 2026 •

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.

Is a fail test the best test we can have now for #135316 ? It means we're not even hitting vtable generation any more.

View changes since the review

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. 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.

MIR borrowck ignores ambiguity in ProvePredicate

5 participants