15 lines
212 B
Rust
15 lines
212 B
Rust
#![feature(coroutines, coroutine_trait)]
|
|
|
|
use std::ops::Coroutine;
|
|
|
|
fn msg() -> u32 {
|
|
0
|
|
}
|
|
|
|
pub fn foo() -> impl Coroutine<(), Yield = (), Return = u32> {
|
|
|| {
|
|
yield;
|
|
return msg();
|
|
}
|
|
}
|