Skip to content

Show the nested goal chain for the next solver overflow FCW - #161341

Open
adwinwhite wants to merge 5 commits into
rust-lang:mainfrom
adwinwhite:overflow-fcw-chain
Open

Show the nested goal chain for the next solver overflow FCW#161341
adwinwhite wants to merge 5 commits into
rust-lang:mainfrom
adwinwhite:overflow-fcw-chain

Conversation

@adwinwhite

@adwinwhite adwinwhite commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Previously we only showed a single root goal for the FCW. It was difficult to find out how the goal overflowed.
We display a proving chain now which should help users identify relevant types or auto traits.

This will affect perf for crates emitting the FCW. E.g. calimero-store goes from 4.7s -> 5.7s in local testing since it emits thousands of FCWs internally. The FCW is a mitigation of future hard error and authors are expected to resolve it so it's probably acceptable. It doesn't affect crates without the FCW.

r? lcnr

@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 Aug 19, 2026
Comment thread compiler/rustc_infer/src/infer/mod.rs Outdated
@@ -344,6 +344,10 @@ pub struct InferCtxt<'tcx> {
/// checking so we disable the FCW there as well.
enable_next_solver_overflow_fcw: bool,

@lcnr lcnr Aug 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change this to a Cell instead? 🤔

View changes since the review

Comment thread compiler/rustc_infer/src/infer/mod.rs Outdated
{
self.in_next_solver_overflow_fcw.set(true);
let ret = f();
self.in_next_solver_overflow_fcw.set(false);

@lcnr lcnr Aug 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

feels safer to replace previous entry and then revert to that one in functions like this, otherwise nesting it twice breaks the outer call

View changes since the review

@rust-log-analyzer

This comment has been minimized.

@adwinwhite
adwinwhite marked this pull request as ready for review August 20, 2026 08:35
@rustbot

rustbot commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@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 Aug 20, 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.

4 participants