mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
aef0f4024a
And suggest adding the `#[coroutine]` to the closure
15 lines
248 B
Rust
15 lines
248 B
Rust
//@ run-pass
|
|
|
|
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
|
|
|
|
use std::ops::Coroutine;
|
|
use std::pin::Pin;
|
|
|
|
fn main() {
|
|
let b = |_| 3;
|
|
let mut a = #[coroutine] || {
|
|
b(yield);
|
|
};
|
|
Pin::new(&mut a).resume(());
|
|
}
|