diff options
| author | bors <bors@rust-lang.org> | 2024-06-28 07:25:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-28 07:25:28 +0000 |
| commit | 99f77a2eda555b50b518f74823ab636a20efb87f (patch) | |
| tree | 8dd11cc66cae04d768306ccb8e6c7e625e25104d /compiler/rustc_parse/src/parser | |
| parent | 42add88d2275b95c98e512ab680436ede691e853 (diff) | |
| parent | 89a0cfe72afe047c699df3810e1ce5e4d9cb98b4 (diff) | |
| download | rust-99f77a2eda555b50b518f74823ab636a20efb87f.tar.gz rust-99f77a2eda555b50b518f74823ab636a20efb87f.zip | |
Auto merge of #127076 - matthiaskrgr:rollup-l01gm36, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #124741 (patchable-function-entry: Add unstable compiler flag and attribute) - #126470 (make cargo submodule optional) - #126956 (core: avoid `extern type`s in formatting infrastructure) - #126970 (Simplify `str::clone_into`) - #127022 (Support fetching `Attribute` of items.) - #127058 (Tighten `fn_decl_span` for async blocks) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index e0c70884fee..3cdc20b6c65 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -3432,8 +3432,9 @@ impl<'a> Parser<'a> { } } let capture_clause = self.parse_capture_clause()?; + let decl_span = lo.to(self.prev_token.span); let (attrs, body) = self.parse_inner_attrs_and_block()?; - let kind = ExprKind::Gen(capture_clause, body, kind); + let kind = ExprKind::Gen(capture_clause, body, kind, decl_span); Ok(self.mk_expr_with_attrs(lo.to(self.prev_token.span), kind, attrs)) } @@ -4022,7 +4023,7 @@ impl MutVisitor for CondChecker<'_> { | ExprKind::Match(_, _, _) | ExprKind::Closure(_) | ExprKind::Block(_, _) - | ExprKind::Gen(_, _, _) + | ExprKind::Gen(_, _, _, _) | ExprKind::TryBlock(_) | ExprKind::Underscore | ExprKind::Path(_, _) |
