blob: e5865d0dfff340ddea23fbbb43b735b4212c4f02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#![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() ];
//~^ `impl Trait` only allowed in function and inherent method return types
}
|