Closed
Description
I tried this code:
// edition 2024
#![feature(gen_blocks)]
fn foo() -> impl Iterator {
gen {
yield;
}
}
I expected to see this happen: The gen blocks RFC does not specify the behavior of bare yield
(without an argument). There are three possible choices, each with good reasons for and against:
- Reject it entirely
- Return
None
fromIterator::next()
- Equivalent to
yield ()
Instead, this happened: The current behavior is that of yield ()
.
Meta
rustc --version
:
1.79.0-nightly (2024-04-06 aa1c45908df252a5b0c1)
cc #117078
@rustbot label F-gen_blocks