Skip to content

Emit delayed bug instead of ICEing when TypeOutlives goal fails - #162026

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ShoyuVanilla:issue-161527
Aug 31, 2026
Merged

Emit delayed bug instead of ICEing when TypeOutlives goal fails#162026
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ShoyuVanilla:issue-161527

Conversation

@ShoyuVanilla

@ShoyuVanilla ShoyuVanilla commented Aug 30, 2026

Copy link
Copy Markdown
Member

Fixes #161527

They can actually fail with the next-solver 😄

fn compute_type_outlives_goal(
&mut self,
goal: Goal<I, ty::OutlivesClause<I, I::Ty>>,
) -> QueryResultOrRerunNonErased<I> {
let ty::OutlivesClause(ty, lt) = goal.predicate;
let ty = self.normalize(GoalSource::Misc, goal.param_env, ty::Unnormalized::new_wip(ty))?;

I have once considered tinkering proof tree/find_best_leaf_obligation to make it suggest the failed normalization goal but I doubt it worths the extra complexity, since we prolly already have other failing obligations in these cases

r? adwinwhite

@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 Aug 30, 2026
@adwinwhite

Copy link
Copy Markdown
Contributor

The diagnostics is strange in the first place. How do we get (): Z<'a, () bound? But that's another problem and we can track it separately.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 44febdf has been approved by adwinwhite

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 31, 2026
@ShoyuVanilla

Copy link
Copy Markdown
Member Author

The diagnostics is strange in the first place. How do we get (): Z<'a, () bound?

It happens like this, strangely recursive 😄

`Z<'a, T>` is well-formed
    `Z<'a, T>`'s where-bound `T: Z<'a, ()>` is well-formed
        `Z<'a, ()>` is well-formed
            `(): Z<'a, ()>` (`Z`'s where bound on its param `T = ()`)

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 31, 2026
…white

Emit delayed bug instead of ICEing when `TypeOutlives` goal fails

Fixes rust-lang#161527

They can actually fail with the next-solver 😄

https://github.com/rust-lang/rust/blob/2e071b28ef7e8a066b49a179e1da753c53500c62/compiler/rustc_next_trait_solver/src/solve/mod.rs#L88-L93

I have once considered tinkering proof tree/`find_best_leaf_obligation` to make it suggest the failed normalization goal but I doubt it worths the extra complexity, since we prolly already have other failing obligations in these cases

r? adwinwhite
rust-bors Bot pushed a commit that referenced this pull request Aug 31, 2026
Rollup of 8 pull requests

Successful merges:

 - #161301 (libcore: expose volatile atomic operations)
 - #161379 (Use better generic type parameter names for `Extend` and `FromIterator`)
 - #161926 (borrowck: Restore alias rigidity from HIR typeck)
 - #161956 (Remove unused `perform_locally_with_next_solver`)
 - #162026 (Emit delayed bug instead of ICEing when `TypeOutlives` goal fails)
 - #162034 (Make the LLVM version mismatch ICE a fatal error)
 - #162037 (LLVM wrapper cleanups)
 - #162043 (_ an unused parameter)
@rust-bors
rust-bors Bot merged commit 85eaa63 into rust-lang:main Aug 31, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 31, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 31, 2026
Rollup merge of #162026 - ShoyuVanilla:issue-161527, r=adwinwhite

Emit delayed bug instead of ICEing when `TypeOutlives` goal fails

Fixes #161527

They can actually fail with the next-solver 😄

https://github.com/rust-lang/rust/blob/2e071b28ef7e8a066b49a179e1da753c53500c62/compiler/rustc_next_trait_solver/src/solve/mod.rs#L88-L93

I have once considered tinkering proof tree/`find_best_leaf_obligation` to make it suggest the failed normalization goal but I doubt it worths the extra complexity, since we prolly already have other failing obligations in these cases

r? adwinwhite
@ShoyuVanilla
ShoyuVanilla deleted the issue-161527 branch August 31, 2026 11:39
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (f797fd8): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary -0.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) - - 0

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: missing data
Artifact size: 307.41 MiB -> 402.64 MiB (30.98%)

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

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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]: outlives clauses should not error outside borrowck

4 participants