Skip to content

Commit

Permalink
Auto merge of rust-lang#121625 - Urgau:non-local-defs_recover_perf, r…
Browse files Browse the repository at this point in the history
…=<try>

Recover most of the perf loss of rust-lang#120393

[rust-lang#120393](rust-lang#120393 (comment))

draft for perf
  • Loading branch information
bors committed Feb 26, 2024
2 parents 0250ef2 + 301ce36 commit d9f0079
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_lint/src/non_local_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
return;
}

if !matches!(item.kind, ItemKind::Impl(_) | ItemKind::Macro(_, _)) {
return;
}

let parent = cx.tcx.parent(item.owner_id.def_id.into());
let parent_def_kind = cx.tcx.def_kind(parent);
let parent_opt_item_name = cx.tcx.opt_item_name(parent);
Expand Down

0 comments on commit d9f0079

Please sign in to comment.