about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-03-27 18:56:19 +0200
committerGitHub <noreply@github.com>2023-03-27 18:56:19 +0200
commitb1e8be783f13dfb2f6e7ade995bde66778a5a43d (patch)
tree013470d0a60dd58afa0676c946a2f9fc59913ef8 /compiler/rustc_resolve/src
parent52c8084f912e3728b8b06ae7e077521dba89d326 (diff)
parentc8ead2e693a22fe94c6b3edeb3f49c7e6aec3912 (diff)
downloadrust-b1e8be783f13dfb2f6e7ade995bde66778a5a43d.tar.gz
rust-b1e8be783f13dfb2f6e7ade995bde66778a5a43d.zip
Rollup merge of #109354 - Swatinem:rm-closureid, r=compiler-errors
Remove the `NodeId` of `ast::ExprKind::Async`

This is a followup to https://github.com/rust-lang/rust/pull/104833#pullrequestreview-1314537416.

In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`.
It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/def_collector.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs
index e7ff236f846..356d7f365fe 100644
--- a/compiler/rustc_resolve/src/def_collector.rs
+++ b/compiler/rustc_resolve/src/def_collector.rs
@@ -260,9 +260,7 @@ impl<'a, 'b, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'b, 'tcx> {
                     Async::No => closure_def,
                 }
             }
-            ExprKind::Async(_, async_id, _) => {
-                self.create_def(async_id, DefPathData::ClosureExpr, expr.span)
-            }
+            ExprKind::Async(_, _) => self.create_def(expr.id, DefPathData::ClosureExpr, expr.span),
             _ => self.parent_def,
         };