Skip to content

Commit d9f0079

Browse files
committed
Auto merge of rust-lang#121625 - Urgau:non-local-defs_recover_perf, r=<try>
Recover most of the perf loss of rust-lang#120393 [rust-lang#120393](rust-lang#120393 (comment)) draft for perf
2 parents 0250ef2 + 301ce36 commit d9f0079

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_lint/src/non_local_def.rs

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
6767
return;
6868
}
6969

70+
if !matches!(item.kind, ItemKind::Impl(_) | ItemKind::Macro(_, _)) {
71+
return;
72+
}
73+
7074
let parent = cx.tcx.parent(item.owner_id.def_id.into());
7175
let parent_def_kind = cx.tcx.def_kind(parent);
7276
let parent_opt_item_name = cx.tcx.opt_item_name(parent);

0 commit comments

Comments
 (0)