blob: 8ee34ec431226f64d458fdcc7b2e8d1f38cf88b9 [file] [log] [blame]
// This demonstrates a proposed alternate or additional option of having yield in postfix position.
//@ edition: 2024
#![feature(gen_blocks, coroutines, coroutine_trait, yield_expr)]
use std::ops::{Coroutine, CoroutineState};
use std::pin::pin;
fn main() {
let mut coro = pin!(
#[coroutine]
|_: i32| {
let x = 1.yield;
(x + 2).await;
}
);
}