Error on using yield
without also using #[coroutine]
on the closure
And suggest adding the `#[coroutine]` to the closure
This commit is contained in:
parent
36449f8cd6
commit
dda4709b1c
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user