diff options
| author | bors <bors@rust-lang.org> | 2023-02-15 16:14:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-15 16:14:10 +0000 |
| commit | 30f38d69ab65036910c7e73c13771bab30afbae1 (patch) | |
| tree | 71f0c4eb36a7903fdc41bf82cb24ceff7f94e336 | |
| parent | 5a8b28871256fe650ef269eacf771ef26fc3ae00 (diff) | |
| parent | e41c37316dbd13eaaef8be50422cfa39ea3835a0 (diff) | |
| download | rust-30f38d69ab65036910c7e73c13771bab30afbae1.tar.gz rust-30f38d69ab65036910c7e73c13771bab30afbae1.zip | |
Auto merge of #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 https://github.com/rust-lang/rust/pull/107942 gets merged. r? `@ghost`
| -rw-r--r-- | clippy_lints/src/same_name_method.rs | 2 | ||||
| -rw-r--r-- | clippy_utils/src/lib.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/same_name_method.rs b/clippy_lints/src/same_name_method.rs index 17763128cd1..a37e2772d35 100644 --- a/clippy_lints/src/same_name_method.rs +++ b/clippy_lints/src/same_name_method.rs @@ -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, diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 26f279f5585..3b8713e2b10 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -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() |
