1
Fork 0

ast: Generalize item kind visiting

And avoid duplicating logic for visiting `Item`s with different kinds (regular, associated, foreign).
This commit is contained in:
Vadim Petrochenkov 2024-04-24 20:31:51 +03:00
parent 38dd569150
commit 5be9fdd636
18 changed files with 410 additions and 382 deletions

View file

@ -99,7 +99,7 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
fn visit_foreign_item(&mut self, it: &'a ast::ForeignItem) {
self.with_lint_attrs(it.id, &it.attrs, |cx| {
ast_visit::walk_foreign_item(cx, it);
ast_visit::walk_item(cx, it);
})
}