mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
15 lines
208 B
Rust
15 lines
208 B
Rust
#![feature(generators, generator_trait)]
|
|
|
|
use std::ops::Generator;
|
|
|
|
fn msg() -> u32 {
|
|
0
|
|
}
|
|
|
|
pub fn foo() -> impl Generator<(), Yield=(), Return=u32> {
|
|
|| {
|
|
yield;
|
|
return msg();
|
|
}
|
|
}
|