We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0250ef2 + 301ce36 commit d9f0079Copy full SHA for d9f0079
compiler/rustc_lint/src/non_local_def.rs
@@ -67,6 +67,10 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
67
return;
68
}
69
70
+ if !matches!(item.kind, ItemKind::Impl(_) | ItemKind::Macro(_, _)) {
71
+ return;
72
+ }
73
+
74
let parent = cx.tcx.parent(item.owner_id.def_id.into());
75
let parent_def_kind = cx.tcx.def_kind(parent);
76
let parent_opt_item_name = cx.tcx.opt_item_name(parent);
0 commit comments