diff options
| author | bors <bors@rust-lang.org> | 2024-04-24 08:43:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-24 08:43:30 +0000 |
| commit | e9362896e0eaaa86372b8ee2634b5761dd9e5ab7 (patch) | |
| tree | 974a23ad8012535719e7cb846b61e10df42a71e0 /compiler/rustc_codegen_gcc | |
| parent | e7da0fa62fc58f9d665a67bf2e7a6d6154d8d74c (diff) | |
| parent | aef0f4024aec24fd7e53dbc51883457e44fe17ce (diff) | |
| download | rust-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 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/example/std_example.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_gcc/example/std_example.rs b/compiler/rustc_codegen_gcc/example/std_example.rs index ad69409eb65..8ab8fcc525e 100644 --- a/compiler/rustc_codegen_gcc/example/std_example.rs +++ b/compiler/rustc_codegen_gcc/example/std_example.rs @@ -1,5 +1,5 @@ #![allow(internal_features)] -#![feature(core_intrinsics, coroutines, coroutine_trait, is_sorted)] +#![feature(core_intrinsics, coroutines, coroutine_trait, is_sorted, stmt_expr_attributes)] #[cfg(feature="master")] #[cfg(target_arch="x86_64")] @@ -103,7 +103,7 @@ fn main() { test_simd(); } - Box::pin(move |mut _task_context| { + Box::pin(#[coroutine] move |mut _task_context| { yield (); }).as_mut().resume(0); |
