2024-04-11 08:15:34 -05:00
|
|
|
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
|
2023-11-25 04:05:52 -06:00
|
|
|
|
|
|
|
use std::ops::Coroutine;
|
|
|
|
use std::pin::Pin;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
run_coroutine::<i32>();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn run_coroutine<T>() {
|
2024-04-11 08:15:34 -05:00
|
|
|
let mut coroutine = #[coroutine]
|
|
|
|
|| {
|
2023-11-25 04:05:52 -06:00
|
|
|
yield;
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
Pin::new(&mut coroutine).resume(());
|
|
|
|
}
|