1
Fork 0
rust/compiler/rustc_parse/src/parser
Matthias Krüger d752721636
Rollup merge of #138435 - eholk:prefix-yield, r=oli-obk
Add support for postfix yield expressions

We've been having a discussion about whether we want postfix yield, or want to stick with prefix yield, or have both. I figured it's easy enough to support both for now and let us play around with them while the feature is still experimental.

This PR treats `yield x` and `x.yield` as semantically equivalent. There was a suggestion to make `yield x` have a `()` type (so it only works in coroutines with `Resume = ()`. I think that'd be worth trying, either in a later PR, or before this one merges, depending on people's opinions.

#43122
2025-03-20 15:36:15 +01:00
..
mut_visit Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
tokenstream update cfg(bootstrap) 2025-01-08 21:26:39 +01:00
attr.rs Provide helpful diagnostics for shebang lookalikes 2025-03-13 19:53:53 +05:30
attr_wrapper.rs Rustfmt 2025-02-08 22:12:13 +00:00
diagnostics.rs If a label is placed on the block of a loop instead of the header, suggest moving it to the header. 2025-03-17 01:59:37 -05:00
expr.rs Rollup merge of #138435 - eholk:prefix-yield, r=oli-obk 2025-03-20 15:36:15 +01:00
generics.rs Implment #[cfg] and #[cfg_attr] in where clauses 2025-03-01 22:02:46 +08:00
item.rs If a label is placed on the block of a loop instead of the header, suggest moving it to the header. 2025-03-17 01:59:37 -05:00
mod.rs If a label is placed on the block of a loop instead of the header, suggest moving it to the header. 2025-03-17 01:59:37 -05:00
nonterminal.rs Remove NtItem and NtStmt. 2025-03-07 14:51:07 +11:00
pat.rs Rename ast::TokenKind::Not as ast::TokenKind::Bang. 2025-03-03 09:26:13 +11:00
path.rs Replace ast::TokenKind::BinOp{,Eq} and remove BinOpToken. 2025-03-03 09:26:11 +11:00
stmt.rs If a label is placed on the block of a loop instead of the header, suggest moving it to the header. 2025-03-17 01:59:37 -05:00
tests.rs Rename ast::TokenKind::Not as ast::TokenKind::Bang. 2025-03-03 09:26:13 +11:00
token_type.rs compiler: Use size_of from the prelude instead of imported 2025-03-07 13:37:04 -08:00
ty.rs Rename ast::TokenKind::Not as ast::TokenKind::Bang. 2025-03-03 09:26:13 +11:00