1
Fork 0

Remove the NodeId of ast::ExprKind::Async

This commit is contained in:
Arpad Borsos 2023-01-31 22:13:25 +01:00
parent ab9bb3ea36
commit c8ead2e693
No known key found for this signature in database
GPG key ID: FC7BCA77824B3298
14 changed files with 56 additions and 64 deletions

View file

@ -1426,13 +1426,9 @@ pub enum ExprKind {
Block(P<Block>, Option<Label>),
/// An async block (`async move { ... }`).
///
/// The `NodeId` is the `NodeId` for the closure that results from
/// desugaring an async block, just like the NodeId field in the
/// `Async::Yes` variant. This is necessary in order to create a def for the
/// closure which can be used as a parent of any child defs. Defs
/// created during lowering cannot be made the parent of any other
/// preexisting defs.
Async(CaptureBy, NodeId, P<Block>),
/// The async block used to have a `NodeId`, which was removed in favor of
/// using the parent `NodeId` of the parent `Expr`.
Async(CaptureBy, P<Block>),
/// An await expression (`my_future.await`).
Await(P<Expr>),

View file

@ -1407,8 +1407,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
vis.visit_block(blk);
visit_opt(label, |label| vis.visit_label(label));
}
ExprKind::Async(_capture_by, node_id, body) => {
vis.visit_id(node_id);
ExprKind::Async(_capture_by, body) => {
vis.visit_block(body);
}
ExprKind::Await(expr) => vis.visit_expr(expr),

View file

@ -860,7 +860,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
walk_list!(visitor, visit_label, opt_label);
visitor.visit_block(block);
}
ExprKind::Async(_, _, body) => {
ExprKind::Async(_, body) => {
visitor.visit_block(body);
}
ExprKind::Await(expr) => visitor.visit_expr(expr),