blob: d07abd0918c7860dabe18800bd3421202b9c1c8d [file] [log] [blame]
#![feature(generators, generator_trait)]
use std::marker::Unpin;
use std::ops::Generator;
pub fn foo() -> impl Generator<(), Yield = (), Return = ()> {
|| {
if false {
yield;
}
}
}
pub fn bar<T: 'static>(t: T) -> Box<Generator<(), Yield = T, Return = ()> + Unpin> {
Box::new(|| {
yield t;
})
}