Add test for #53678.

This commit is contained in:
Mazdak Farrokhzad 2019-07-29 04:07:33 +02:00
parent b2a5d99705
commit b779f45fed

View file

@ -0,0 +1,19 @@
// check-pass
#![feature(const_fn, generators, generator_trait, existential_type)]
use std::ops::Generator;
existential type GenOnce<Y, R>: Generator<Yield = Y, Return = R>;
const fn const_generator<Y, R>(yielding: Y, returning: R) -> GenOnce<Y, R> {
move || {
yield yielding;
return returning;
}
}
const FOO: GenOnce<usize, usize> = const_generator(10, 100);
fn main() {}