2018-09-06 14:41:12 +02:00
|
|
|
// run-pass
|
|
|
|
|
2017-10-07 16:36:28 +02:00
|
|
|
#![feature(generators, generator_trait)]
|
|
|
|
|
|
|
|
use std::ops::Generator;
|
2018-10-04 20:49:38 +02:00
|
|
|
use std::pin::Pin;
|
2017-10-07 16:36:28 +02:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let b = |_| 3;
|
|
|
|
let mut a = || {
|
|
|
|
b(yield);
|
|
|
|
};
|
2020-01-25 20:03:10 +01:00
|
|
|
Pin::new(&mut a).resume(());
|
2017-10-07 16:36:28 +02:00
|
|
|
}
|