2021-07-22 13:16:33 -05:00
|
|
|
#![feature(generators, generator_trait, never_type)]
|
|
|
|
|
|
|
|
use std::ops::Generator;
|
|
|
|
|
|
|
|
fn mk_gen() -> impl Generator<Return=!, Yield=()> {
|
|
|
|
|| { loop { yield; } }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let gens: [impl Generator<Return=!, Yield=()>;2] = [ mk_gen(), mk_gen() ];
|
2022-02-17 21:18:42 -06:00
|
|
|
//~^ `impl Trait` only allowed in function and inherent method return types
|
2021-07-22 13:16:33 -05:00
|
|
|
}
|