Add of_trait to DefKind::Impl.

This commit is contained in:
Camille GILLOT 2023-02-12 18:26:47 +00:00
parent 42d4bd7d18
commit e41c37316d
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
let mut map = FxHashMap::<Res, ExistingName>::default(); let mut map = FxHashMap::<Res, ExistingName>::default();
for id in cx.tcx.hir().items() { 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 item = cx.tcx.hir().item(id)
&& let ItemKind::Impl(Impl { && let ItemKind::Impl(Impl {
items, items,

View File

@ -552,7 +552,7 @@ fn non_local_item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol)
.filter(|item| item.ident.name == name) .filter(|item| item.ident.name == name)
.map(|child| child.res.expect_non_local()) .map(|child| child.res.expect_non_local())
.collect(), .collect(),
DefKind::Impl => tcx DefKind::Impl { .. } => tcx
.associated_item_def_ids(def_id) .associated_item_def_ids(def_id)
.iter() .iter()
.copied() .copied()