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.
This commit is contained in:
Guillaume Gomez 2023-03-27 18:56:19 +02:00 committed by GitHub
commit b1e8be783f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 56 additions and 64 deletions

View file

@ -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,
};