1
Fork 0

Tighten spans for async blocks

This commit is contained in:
Michael Goulet 2024-06-27 14:56:57 -04:00
parent 036b38ced3
commit 789ee88bd0
43 changed files with 173 additions and 204 deletions

View file

@ -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(_, _)