diff options
| author | Arpad Borsos <swatinem@swatinem.de> | 2023-01-31 22:13:25 +0100 |
|---|---|---|
| committer | Arpad Borsos <swatinem@swatinem.de> | 2023-03-19 19:01:31 +0100 |
| commit | c8ead2e693a22fe94c6b3edeb3f49c7e6aec3912 (patch) | |
| tree | 07e83c69328ae2c509faba9ccb881ef55e4afc78 /compiler/rustc_ast/src | |
| parent | ab9bb3ea368b2412531a3e8c07ba73d1dd690134 (diff) | |
| download | rust-c8ead2e693a22fe94c6b3edeb3f49c7e6aec3912.tar.gz rust-c8ead2e693a22fe94c6b3edeb3f49c7e6aec3912.zip | |
Remove the `NodeId` of `ast::ExprKind::Async`
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/mut_visit.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/visit.rs | 2 |
3 files changed, 5 insertions, 10 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 5d164bc4b3c..ab8b7f632e8 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -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>), diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index 45a5a3ecb53..46e46ab575e 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -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), diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs index 9a4da6d4396..608f87ab6eb 100644 --- a/compiler/rustc_ast/src/visit.rs +++ b/compiler/rustc_ast/src/visit.rs @@ -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), |
