2018-09-06 14:41:12 +02:00
|
|
|
//@ run-pass
|
|
|
|
|
2024-04-11 13:15:34 +00:00
|
|
|
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
|
2017-10-07 16:36:28 +02:00
|
|
|
|
2023-10-19 16:06:43 +00:00
|
|
|
use std::ops::Coroutine;
|
2018-10-04 20:49:38 +02:00
|
|
|
use std::pin::Pin;
|
2017-10-07 16:36:28 +02:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let b = |_| 3;
|
2024-04-11 13:15:34 +00:00
|
|
|
let mut a = #[coroutine] || {
|
2017-10-07 16:36:28 +02:00
|
|
|
b(yield);
|
|
|
|
};
|
2020-01-25 20:03:10 +01:00
|
|
|
Pin::new(&mut a).resume(());
|
2017-10-07 16:36:28 +02:00
|
|
|
}
|