blob: 0b5d18823004af1f88e2eb0d89d3c7b2b9ff7277 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#![feature(coroutines, coroutine_trait)]
use std::ops::Coroutine;
fn msg() -> u32 {
0
}
pub fn foo() -> impl Coroutine<(), Yield = (), Return = u32> {
#[coroutine]
|| {
yield;
return msg();
}
}
|