rust/tests/ui/coroutine/gen_block_is_fused_iter.rs

22 lines
405 B
Rust

//@ revisions: next old
//@compile-flags: --edition 2024 -Zunstable-options
//@[next] compile-flags: -Znext-solver
//@ check-pass
#![feature(gen_blocks)]
use std::iter::FusedIterator;
fn foo() -> impl FusedIterator {
gen { yield 42 }
}
fn bar() -> impl FusedIterator<Item = u16> {
gen { yield 42 }
}
fn baz() -> impl FusedIterator + Iterator<Item = i64> {
gen { yield 42 }
}
fn main() {}