rust/tests/ui/impl-trait/issues/issue-58504.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
325 B
Rust
Raw Normal View History

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