mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
13 lines
335 B
Rust
13 lines
335 B
Rust
#![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
|
|
}
|