Skip to content

Commit 538e8bd

Browse files
Rollup merge of rust-lang#109354 - Swatinem:rm-closureid, r=compiler-errors
Remove the `NodeId` of `ast::ExprKind::Async` This is a followup to rust-lang#104833 (review). 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.
2 parents db4e4af + 1e17a44 commit 538e8bd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/redundant_async_block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl EarlyLintPass for RedundantAsyncBlock {
4242
if expr.span.from_expansion() {
4343
return;
4444
}
45-
if let ExprKind::Async(_, _, block) = &expr.kind && block.stmts.len() == 1 &&
45+
if let ExprKind::Async(_, block) = &expr.kind && block.stmts.len() == 1 &&
4646
let Some(Stmt { kind: StmtKind::Expr(last), .. }) = block.stmts.last() &&
4747
let ExprKind::Await(future) = &last.kind &&
4848
!future.span.from_expansion() &&

clippy_lints/src/suspicious_operation_groupings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ fn ident_difference_expr_with_base_location(
578578
| (Assign(_, _, _), Assign(_, _, _))
579579
| (TryBlock(_), TryBlock(_))
580580
| (Await(_), Await(_))
581-
| (Async(_, _, _), Async(_, _, _))
581+
| (Async(_, _), Async(_, _))
582582
| (Block(_, _), Block(_, _))
583583
| (Closure(_), Closure(_))
584584
| (Match(_, _), Match(_, _))

clippy_utils/src/ast_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
209209
&& eq_fn_decl(lf, rf)
210210
&& eq_expr(le, re)
211211
},
212-
(Async(lc, _, lb), Async(rc, _, rb)) => lc == rc && eq_block(lb, rb),
212+
(Async(lc, lb), Async(rc, rb)) => lc == rc && eq_block(lb, rb),
213213
(Range(lf, lt, ll), Range(rf, rt, rl)) => ll == rl && eq_expr_opt(lf, rf) && eq_expr_opt(lt, rt),
214214
(AddrOf(lbk, lm, le), AddrOf(rbk, rm, re)) => lbk == rbk && lm == rm && eq_expr(le, re),
215215
(Path(lq, lp), Path(rq, rp)) => both(lq, rq, eq_qself) && eq_path(lp, rp),

0 commit comments

Comments
 (0)