Skip to content

be more permissive wrt overflow and and improve diagnostics - #161341

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

be more permissive wrt overflow and and improve diagnostics#161341
adwinwhite wants to merge 6 commits into
rust-lang:mainfrom
adwinwhite:overflow-fcw-chain

Conversation

@adwinwhite

@adwinwhite adwinwhite commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

View all comments

This builds on #160632

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
Comment thread compiler/rustc_infer/src/infer/mod.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@adwinwhite
adwinwhite force-pushed the overflow-fcw-chain branch 2 times, most recently from 61aecad to ce9f31f Compare August 20, 2026 08:25
@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
@rust-bors

This comment has been minimized.

Comment thread compiler/rustc_infer/src/infer/mod.rs Outdated
Comment thread compiler/rustc_type_ir/src/search_graph/mod.rs Outdated
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "16"]` attribute to your crate (`fcw_on_normalization`)
= help: or consider adding a manual `impl` of auto traits like `Send` for intermediate types, if auto traits are involved
= note: which requires <W<W<W<W<W<W<W<W<W<()>>>>>>>>> as HasAssoc>::Assoc == ()
= note: which requires <W<W<W<W<W<W<W<W<()>>>>>>>> as HasAssoc>::Assoc == ()

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

why does this stop after 2 goals? that's surprising

View changes since the review

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.

oh, that's because Projection goals don't add their nested NormalizesTo goal as a nested goal for proof trees 🤔 that sucks

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.

}

fn visit_goal(&mut self, goal: &inspect::InspectGoal<'_, 'tcx>) -> Self::Result {
self.predicates.push(goal.goal().predicate);

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

does this currently print both NormalizesTo and the Projection goal? if so, we should probably filter the NormalizesTo goal here :>

View changes since the review

@lcnr lcnr changed the title Show the nested goal chain for the next solver overflow FCW be more permissive wrt overflow and and improve diagnostics Aug 22, 2026
@lcnr
lcnr force-pushed the overflow-fcw-chain branch from ce9f31f to 3f63986 Compare August 22, 2026 17:04
@rustbot

rustbot commented Aug 22, 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.

@lcnr

lcnr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

first three commits were approved by adwin in #160632, r=me on the second 2 with my applied nits in the last commit, which feel small enough to not require an additional review

wrt to perf

Similar to #160254, the current perf collection won't be affected by this as they don't overflow(maybe except typenum)?

@bors r=lcnr,adwinwhite rollup

@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3f63986 has been approved by lcnr,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 22, 2026
@lcnr

lcnr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

@bors r-

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2026
@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

View changes since this unapproval

@lcnr
lcnr force-pushed the overflow-fcw-chain branch from 3f63986 to a868158 Compare August 22, 2026 18:20
@lcnr

lcnr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

@bors r=lcnr,adwinwhite rollup

@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a868158 has been approved by lcnr,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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 22, 2026
@lcnr
lcnr force-pushed the overflow-fcw-chain branch from a868158 to fbc1635 Compare August 22, 2026 18:43
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2026
@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

⚠️ A new commit fbc16357117040b3aa3270b8890fe5758f1ff0f9 was pushed.

This pull request was unapproved.

@lcnr
lcnr force-pushed the overflow-fcw-chain branch from fbc1635 to 3f63986 Compare August 22, 2026 18:49
@lcnr

lcnr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

having the same branch for both this and #161552 really is not ideal

@bors r=lcnr,adwinwhite rollup

@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3f63986 has been approved by lcnr,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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
…cnr,adwinwhite

be more permissive wrt overflow and and improve diagnostics

This builds on rust-lang#160632

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
rust-bors Bot pushed a commit that referenced this pull request Aug 22, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #157513 (Reject non-constructor self types in const-arg tuple-call lowering)
 - #159887 (compiletest: forward disable-minification from bootstrap)
 - #160949 (Add floating point inline ASM support for SPARC)
 - #156160 (feat: add symmetric PartialEq impls for Vec, &[T], &mut [T] versus Cow<'_, [T]>)
 - #160302 (target_features: sse (or at least avx2) is incompatible with soft-float ABI)
 - #160914 (Derive `GenericTypeVisitable` for `RegionConstraint` _correctly_)
 - #161341 (be more permissive wrt overflow and and improve diagnostics)
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 22, 2026
…cnr,adwinwhite

be more permissive wrt overflow and and improve diagnostics

This builds on rust-lang#160632

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

4 participants