Add test for #53678.
This commit is contained in:
parent
b2a5d99705
commit
b779f45fed
1 changed files with 19 additions and 0 deletions
|
@ -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() {}
|
Loading…
Add table
Reference in a new issue