Exponential compile time increase when nesting async closures in 1.86 #140004
Labels
C-bug
Category: This is a bug.
I-compiletime
Issue: Problems and improvements with respect to compile times.
S-needs-repro
Status: This issue has no reproduction and needs a reproduction to make progress.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In a library that is chaining together a series of operations, I have it structured roughly like this:
In this code, it's used by calling
.prop
over and over again passing an async closure to create a stack of futures that will run all at once the response is to be evaluated. I noticed that for each.prop
call added, the compile time increases exponentially until it reaches hours.Additionally, I can confirm that this is happening during the MIR phase of compilation. Cargo check and rust analyzer (as well as a custom rustc driver being used for type generation) all fly through compiling this code, it's only when
cargo build
is executed that this issue occurs. I found no significant difference when attempting this during release or debug builds.I have confirmed that this happens in 1.85 (when async closures were stabilized), 1.86, and nightly.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: