Skip to content

Commit 30f38d6

Browse files
committed
Auto merge of rust-lang#108006 - cjgillot:def-impl, r=oli-obk
Avoid accessing HIR when it can be avoided Experiment to see if it helps some incremental cases. Will be rebased once rust-lang#107942 gets merged. r? `@ghost`
2 parents 5a8b288 + e41c373 commit 30f38d6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/same_name_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
5252
let mut map = FxHashMap::<Res, ExistingName>::default();
5353

5454
for id in cx.tcx.hir().items() {
55-
if matches!(cx.tcx.def_kind(id.owner_id), DefKind::Impl)
55+
if matches!(cx.tcx.def_kind(id.owner_id), DefKind::Impl { .. })
5656
&& let item = cx.tcx.hir().item(id)
5757
&& let ItemKind::Impl(Impl {
5858
items,

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ fn non_local_item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol)
552552
.filter(|item| item.ident.name == name)
553553
.map(|child| child.res.expect_non_local())
554554
.collect(),
555-
DefKind::Impl => tcx
555+
DefKind::Impl { .. } => tcx
556556
.associated_item_def_ids(def_id)
557557
.iter()
558558
.copied()

0 commit comments

Comments
 (0)