mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
15 lines
212 B
Rust
15 lines
212 B
Rust
// run-pass
|
|
|
|
#![feature(generators, generator_trait)]
|
|
|
|
use std::ops::Generator;
|
|
use std::pin::Pin;
|
|
|
|
fn main() {
|
|
let b = |_| 3;
|
|
let mut a = || {
|
|
b(yield);
|
|
};
|
|
Pin::new(&mut a).resume(());
|
|
}
|