Skip to content

Do not increase recursion depth for coroutine witness and rigid opaques when proving auto traits - #162275

Open
adwinwhite wants to merge 1 commit into
rust-lang:mainfrom
adwinwhite:half-depth
Open

Do not increase recursion depth for coroutine witness and rigid opaques when proving auto traits#162275
adwinwhite wants to merge 1 commit into
rust-lang:mainfrom
adwinwhite:half-depth

Conversation

@adwinwhite

@adwinwhite adwinwhite commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

With deeply nested async calls, we can easily overflow evaluating auto trait goals as shown in #159228.
Users have no choice but increase the per-crate recursion_limit which is bad for compilation time/RSS. And downstream users may encounter the same warnings when calling library async functions.

We mitigate that by no longer increasing recursion depth for coroutine witness and rigid opaques when proving auto traits. See the comments for why it's okay to do so.
This fix actually makes the required depth a third of what it was before for async calls.

I've checked locally that bors and triagebot no longer have FCWs.

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 Sep 4, 2026
@adwinwhite
adwinwhite marked this pull request as ready for review September 4, 2026 06:13
@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 4, 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.

3 participants