Make [clippy::dump]
support trait items
This commit is contained in:
parent
8a9860901f
commit
c642cfe3bf
@ -1,4 +1,5 @@
|
||||
use clippy_utils::get_attr;
|
||||
use hir::TraitItem;
|
||||
use rustc_hir as hir;
|
||||
use rustc_lint::{LateContext, LateLintPass, LintContext};
|
||||
use rustc_session::{declare_lint_pass, declare_tool_lint};
|
||||
@ -47,6 +48,18 @@ fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) {
|
||||
println!("{stmt:#?}");
|
||||
}
|
||||
}
|
||||
|
||||
fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &TraitItem<'_>) {
|
||||
if has_attr(cx, item.hir_id()) {
|
||||
println!("{item:#?}");
|
||||
}
|
||||
}
|
||||
|
||||
fn check_impl_item(&mut self, cx: &LateContext<'_>, item: &hir::ImplItem<'_>) {
|
||||
if has_attr(cx, item.hir_id()) {
|
||||
println!("{item:#?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn has_attr(cx: &LateContext<'_>, hir_id: hir::HirId) -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user