2023-10-19 21:46:28 +00:00
|
|
|
#![feature(coroutines, coroutine_trait, never_type)]
|
2021-07-22 19:16:33 +01:00
|
|
|
|
2023-10-19 16:06:43 +00:00
|
|
|
use std::ops::Coroutine;
|
2021-07-22 19:16:33 +01:00
|
|
|
|
2023-10-19 16:06:43 +00:00
|
|
|
fn mk_gen() -> impl Coroutine<Return=!, Yield=()> {
|
2021-07-22 19:16:33 +01:00
|
|
|
|| { loop { yield; } }
|
|
|
|
}
|
|
|
|
|
|
|
|
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 19:16:33 +01:00
|
|
|
}
|