diff options
| author | bors <bors@rust-lang.org> | 2024-04-25 06:48:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-25 06:48:37 +0000 |
| commit | 9d7a47fe31c049d32989ee41efec61b57ea1a4e0 (patch) | |
| tree | 32f82f6179297d50ad208b9e57d39171f8e1635f /compiler/rustc_codegen_cranelift/example | |
| parent | c69c79d42a691b2f8402d18ec87fb0e0873f1bf2 (diff) | |
| parent | 258e5043a156a87497f98d5220624545658aad0b (diff) | |
| download | rust-9d7a47fe31c049d32989ee41efec61b57ea1a4e0.tar.gz rust-9d7a47fe31c049d32989ee41efec61b57ea1a4e0.zip | |
Auto merge of #3513 - rust-lang:rustup-2024-04-25, r=RalfJung
Automatic Rustup
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/std_example.rs | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs b/compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs index c965b34e13b..407da94c0f0 100644 --- a/compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs +++ b/compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs @@ -1,4 +1,4 @@ -#![feature(coroutines, coroutine_trait)] +#![feature(coroutines, coroutine_trait, stmt_expr_attributes)] use std::ops::Coroutine; use std::pin::Pin; @@ -8,7 +8,8 @@ fn main() { } fn run_coroutine<T>() { - let mut coroutine = || { + let mut coroutine = #[coroutine] + || { yield; return; }; diff --git a/compiler/rustc_codegen_cranelift/example/std_example.rs b/compiler/rustc_codegen_cranelift/example/std_example.rs index 0205de55622..90d4ab721da 100644 --- a/compiler/rustc_codegen_cranelift/example/std_example.rs +++ b/compiler/rustc_codegen_cranelift/example/std_example.rs @@ -1,6 +1,7 @@ #![feature( core_intrinsics, coroutines, + stmt_expr_attributes, coroutine_trait, is_sorted, repr_simd, @@ -123,9 +124,12 @@ fn main() { test_simd(); } - Box::pin(move |mut _task_context| { - yield (); - }) + Box::pin( + #[coroutine] + move |mut _task_context| { + yield (); + }, + ) .as_mut() .resume(0); |
