summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-58504.rs
blob: 03b51ae92d18931832f3d4190777a348175f5745 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#![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` only allowed in function and inherent method argument and return types
}