Add iter macro

This adds an `iter!` macro that can be used to create movable
generators.

This also adds a yield_expr feature so the `yield` keyword can be used
within iter! macro bodies. This was needed because several unstable
features each need `yield` expressions, so this allows us to stabilize
them separately from any individual feature.

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
Co-authored-by: Travis Cross <tc@traviscross.com>
This commit is contained in:
Oli Scherer
2025-02-27 09:51:23 +00:00
committed by Eric Holk
parent aae43c4532
commit 5fbdfc3e10
43 changed files with 826 additions and 61 deletions

View File

@@ -713,7 +713,7 @@ impl<'a> Parser<'a> {
/// Parses the rest of a block expression or function body.
/// Precondition: already parsed the '{'.
pub(crate) fn parse_block_tail(
pub fn parse_block_tail(
&mut self,
lo: Span,
s: BlockCheckMode,