about summary refs log tree commit diff
path: root/tests/ui/async-await/async-drop
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-04 19:50:21 +0200
committerGitHub <noreply@github.com>2025-06-04 19:50:21 +0200
commit9ec41bcf72dd30d72cef2c3ea7bb8616e41585ce (patch)
treef0cdf39997b216bb2cc54e5e11f3d2cb7632c872 /tests/ui/async-await/async-drop
parent4151d15287d0e5e6c17965050624b885039ef915 (diff)
parentd5a9a005188322cd08dca018402e1593d3a5ebd5 (diff)
downloadrust-9ec41bcf72dd30d72cef2c3ea7bb8616e41585ce.tar.gz
rust-9ec41bcf72dd30d72cef2c3ea7bb8616e41585ce.zip
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
Diffstat (limited to 'tests/ui/async-await/async-drop')
-rw-r--r--tests/ui/async-await/async-drop/assign-incompatible-types.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/async-await/async-drop/assign-incompatible-types.rs b/tests/ui/async-await/async-drop/assign-incompatible-types.rs
new file mode 100644
index 00000000000..359939ff9ac
--- /dev/null
+++ b/tests/ui/async-await/async-drop/assign-incompatible-types.rs
@@ -0,0 +1,9 @@
+// ex-ice: #140530
+//@ edition: 2024
+//@ build-pass
+#![feature(async_drop, gen_blocks)]
+#![allow(incomplete_features)]
+async gen fn a() {
+  _ = async {}
+}
+fn main() {}