Tighten spans for async blocks
This commit is contained in:
parent
036b38ced3
commit
789ee88bd0
43 changed files with 173 additions and 204 deletions
|
@ -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(_, _)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue