Repository navigation
Description
Code
This needs no feature gates and no AsyncDrop impl: two types that are mutually recursive through a Box, with a value of one of them alive across an .await.
pub enum A {
X(Box<B>),
}
pub enum B {
Y(A),
}
pub async fn run(a: Option<A>) {
async {}.await;
drop(a);
}cargo check on a library crate (edition 2024) containing only the code above.
Current output
error[E0391]: cycle detected when computing when `A` needs async drop
--> src/lib.rs:1:1
|
1 | pub enum A {
| ^^^^^^^^^^
|
= note: ...which immediately requires computing when `A` needs async drop again
note: cycle used when computing whether `core::option::Option<A>` needs async drop
--> /rustc/f9ceb4a4d45a471eed7bd8c40dddb7c38e749e21/library/core/src/option.rs:598:0
= note: for more information, see <https://rustc-dev-guide.rust-lang.org/overview.html#queries> and <https://rustc-dev-guide.rust-lang.org/query.html>
Expected
It compiles, as it does on nightly-2026-10-31 (rustc 1.101.0-nightly (92b5b8c87 2026-10-29)) and on stable.
Real-world impact
sqlx-core 0.8.6 no longer compiles on the latest nightly: its Error contains Migrate(Box<MigrateError>), and MigrateError contains Error, so Result<(), Error> held across an .await hits the same cycle:
error[E0391]: cycle detected when computing when `error::Error` needs async drop
--> .../sqlx-core-0.8.6/src/error.rs:32:1
|
32 | pub enum Error {
| ^^^^^^^^^^^^^^
|
= note: ...which immediately requires computing when `error::Error` needs async drop again
note: cycle used when computing whether `core::result::Result<(), error::Error>` needs async drop
Any crate depending on sqlx (with the migrate feature) fails to build on nightly, e.g. our CI: https://github.com/y-scope/clp/actions/runs/41262307638/job/124717885872
Bisection
cargo bisect-rustc --start 92b5b8c87c61b20adc9001b41baf587634a74734 --end f9ceb4a4d45a471eed7bd8c40dddb7c38e749e21 --access github --regress error -- check reports:
Regression in https://github.com/rust-lang/rust/commit/8465957442411717fd22366e6d219c2961e92dd4
That's the merge of rollup #165234. The only PR in it touching async-drop analysis is #164987 ("use adt_async_drop_tys for nested ADTs in needs_async_drop"), so I suspect it, though I haven't bisected inside the rollup. Possibly related: #164977 (a similar cycle for recursive types, but only with feature(async_drop)).
Version
rustc 1.101.0-nightly (f9ceb4a4d 2026-10-31)
binary: rustc
commit-hash: f9ceb4a4d45a471eed7bd8c40dddb7c38e749e21
commit-date: 2026-10-31
host: x86_64-unknown-linux-gnu
release: 1.101.0-nightly
LLVM version: 23.1.4
@rustbot label +regression-from-stable-to-nightly
Activity
theemathas commentedon Nov 1, 2026
cc @Web4everyone32 (author of #164987), @oli-obk (reviewer)
cyx2015s commentedon Nov 1, 2026
No need to
.await.Minimal reproduce:
Environment:
16 remaining items
chore(ci): pin fuzz toolchain to nightly-2026-10-30 (#413)
ci(fuzzer): pin nightly to 2026-10-31 (#981)
vault: real target tables for platform deps; fuzz ASan builds on a da…
ci(fuzz): fall back to an older nightly when the latest cannot build
ci(fuzz): fall back to an older nightly when the latest cannot build
ci(fuzz): fall back to an older nightly when the latest cannot build
Rollup merge of rust-lang#165266 - maxdexh:issue-165263, r=oli-obk
Unrolled build for #165266 in rollup 165270
ci: pin the docs build to the installed nightly
ci: pin nightly to 2026-10-31 (#8823)
ci: restore the required checks on op-v2.6.0 (#30)
docs: external engines premises, decisions 9-13, and the plan skeleton
chore(nix): bump rust-overlay (nightly 2026-11-02), for nemo-physical (…