about summary refs log tree commit diff
path: root/tests/debuginfo/coroutine-objects.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-24 08:43:30 +0000
committerbors <bors@rust-lang.org>2024-04-24 08:43:30 +0000
commite9362896e0eaaa86372b8ee2634b5761dd9e5ab7 (patch)
tree974a23ad8012535719e7cb846b61e10df42a71e0 /tests/debuginfo/coroutine-objects.rs
parente7da0fa62fc58f9d665a67bf2e7a6d6154d8d74c (diff)
parentaef0f4024aec24fd7e53dbc51883457e44fe17ce (diff)
downloadrust-e9362896e0eaaa86372b8ee2634b5761dd9e5ab7.tar.gz
rust-e9362896e0eaaa86372b8ee2634b5761dd9e5ab7.zip
Auto merge of #123792 - oli-obk:coroutine_closures, r=compiler-errors
Require explicitly marking closures as coroutines

instead of relying on patching up the closure to be a coroutine if it happens to contain a `yield` expression.

I only do this in the 2024 edition, as the `gen` keyword is only available there.
Diffstat (limited to 'tests/debuginfo/coroutine-objects.rs')
-rw-r--r--tests/debuginfo/coroutine-objects.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/debuginfo/coroutine-objects.rs b/tests/debuginfo/coroutine-objects.rs
index 9e1bd5d62e7..e13f20455a8 100644
--- a/tests/debuginfo/coroutine-objects.rs
+++ b/tests/debuginfo/coroutine-objects.rs
@@ -63,7 +63,7 @@
 // cdb-check: b                : Returned [Type: enum2$<coroutine_objects::main::coroutine_env$0>]
 // cdb-check:    [+0x[...]] _ref__a          : 0x[...] : 6 [Type: int *]
 
-#![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait)]
+#![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait, stmt_expr_attributes)]
 #![omit_gdb_pretty_printer_section]
 
 use std::ops::Coroutine;
@@ -71,7 +71,8 @@ use std::pin::Pin;
 
 fn main() {
     let mut a = 5;
-    let mut b = || {
+    let mut b = #[coroutine]
+    || {
         let mut c = 6;
         let mut d = 7;