Skip to content

Commit

Permalink
Auto merge of rust-lang#108006 - cjgillot:def-impl, r=oli-obk
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
bors committed Feb 15, 2023
2 parents 5a8b288 + e41c373 commit 30f38d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/same_name_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
let mut map = FxHashMap::<Res, ExistingName>::default();

for id in cx.tcx.hir().items() {
if matches!(cx.tcx.def_kind(id.owner_id), DefKind::Impl)
if matches!(cx.tcx.def_kind(id.owner_id), DefKind::Impl { .. })
&& let item = cx.tcx.hir().item(id)
&& let ItemKind::Impl(Impl {
items,
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ fn non_local_item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol)
.filter(|item| item.ident.name == name)
.map(|child| child.res.expect_non_local())
.collect(),
DefKind::Impl => tcx
DefKind::Impl { .. } => tcx
.associated_item_def_ids(def_id)
.iter()
.copied()
Expand Down

0 comments on commit 30f38d6

Please sign in to comment.