Rollup merge of #141932 - azhogin:azhogin/async-drop-inside-asyncgen-fix, r=oli-obk

Fix for async drop inside async gen fn

Return value (for yield) is corrected for async drop inside async gen function.
In CFG, when internal async drop future is polled and returned `Poll<()>::Pending`, then async gen resume function returns `Poll<(OptRet)>::Pending`.

Fixes rust-lang/rust#140530
This commit is contained in:
Matthias Krüger 2025-06-04 19:50:21 +02:00 committed by GitHub
commit 9ec41bcf72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 8 deletions

View file

@ -1,7 +1,8 @@
//@ known-bug: #140530
// ex-ice: #140530
//@ edition: 2024
//@ build-pass
#![feature(async_drop, gen_blocks)]
#![allow(incomplete_features)]
async gen fn a() {
_ = async {}
}