-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.F-gen_blocks`gen {}` expressions that produce `Iterator`s`gen {}` expressions that produce `Iterator`s
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
wmstack
Metadata
Metadata
Assignees
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.F-gen_blocks`gen {}` expressions that produce `Iterator`s`gen {}` expressions that produce `Iterator`s