diff options
| author | Michael Goulet <michael@errs.io> | 2024-06-27 14:56:57 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-06-27 15:19:08 -0400 |
| commit | 789ee88bd015fde4257464d0120ab57b0d744e0b (patch) | |
| tree | 20bb0d5902aa66021f0ba6483f1b831025744d8c /compiler/rustc_parse/src/parser | |
| parent | 036b38ced36b0ed16579f95b4647ba7424f6b1bc (diff) | |
| download | rust-789ee88bd015fde4257464d0120ab57b0d744e0b.tar.gz rust-789ee88bd015fde4257464d0120ab57b0d744e0b.zip | |
Tighten spans for async blocks
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(_, _) |
