rust/tests/ui/impl-trait/issues/issue-58504.rs
2024-01-07 18:00:03 +00:00

13 lines
325 B
Rust

#![feature(coroutines, coroutine_trait, never_type)]
use std::ops::Coroutine;
fn mk_gen() -> impl Coroutine<Return=!, Yield=()> {
|| { loop { yield; } }
}
fn main() {
let gens: [impl Coroutine<Return=!, Yield=()>;2] = [ mk_gen(), mk_gen() ];
//~^ `impl Trait` is not allowed in the type of variable bindings
}