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