Skip to content

Polymorphic recursion in async fn gives "queries overflow the depth limit" error #140728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
theemathas opened this issue May 7, 2025 · 0 comments
Labels
A-async-await Area: Async & Await A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. I-cycle Issue: A query cycle occurred while none was expected T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@theemathas
Copy link
Contributor

theemathas commented May 7, 2025

Code

async fn recurse<T>() {
    recurse::<Option<T>>().await;
}

Current output

error: queries overflow the depth limit!
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`playground`)
  = note: query depth increased by 130 when computing layout of `{async fn body of recurse<T>()}`

Desired output

Something that doesn't mention queries, and more prominently point me towards the recurse() function being the problem.

Rationale and extra context

No response

Other cases

Rust Version

Reproducible on the playground with version: 1.88.0-nightly (2025-05-06 27d6200a70601f6fcf41)

Anything else?

Discovered while experimenting with #140725

@theemathas theemathas added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 7, 2025
@saethlin saethlin added A-async-await Area: Async & Await I-cycle Issue: A query cycle occurred while none was expected C-bug Category: This is a bug. labels May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. I-cycle Issue: A query cycle occurred while none was expected T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants