summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_lint/src/early.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /compiler/rustc_lint/src/early.rs
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_lint/src/early.rs')
-rw-r--r--compiler/rustc_lint/src/early.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_lint/src/early.rs b/compiler/rustc_lint/src/early.rs
index 337a19dd0..65607d718 100644
--- a/compiler/rustc_lint/src/early.rs
+++ b/compiler/rustc_lint/src/early.rs
@@ -224,8 +224,7 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
ast::ExprKind::Closure(box ast::Closure {
asyncness: ast::Async::Yes { closure_id, .. },
..
- })
- | ast::ExprKind::Async(_, closure_id, ..) => self.check_id(closure_id),
+ }) => self.check_id(closure_id),
_ => {}
}
}
@@ -341,7 +340,7 @@ pub trait EarlyCheckNode<'a>: Copy {
'a: 'b;
}
-impl<'a> EarlyCheckNode<'a> for &'a ast::Crate {
+impl<'a> EarlyCheckNode<'a> for (&'a ast::Crate, &'a [ast::Attribute]) {
fn id(self) -> ast::NodeId {
ast::CRATE_NODE_ID
}
@@ -349,15 +348,15 @@ impl<'a> EarlyCheckNode<'a> for &'a ast::Crate {
where
'a: 'b,
{
- &self.attrs
+ &self.1
}
fn check<'b, T: EarlyLintPass>(self, cx: &mut EarlyContextAndPass<'b, T>)
where
'a: 'b,
{
- lint_callback!(cx, check_crate, self);
- ast_visit::walk_crate(cx, self);
- lint_callback!(cx, check_crate_post, self);
+ lint_callback!(cx, check_crate, self.0);
+ ast_visit::walk_crate(cx, self.0);
+ lint_callback!(cx, check_crate_post, self.0);
}
}