diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-10-27 14:02:18 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-10-29 20:28:38 +1100 |
| commit | efca32e23ab1cc27cd6b1e5ec42faf848fea5fc3 (patch) | |
| tree | 803f16e6f0ef7526fec1114e4aa7349c29432a2a /clippy_lints/src/same_name_method.rs | |
| parent | 26eeeeec7610e45975745a60226dc8a980ed684e (diff) | |
| download | rust-efca32e23ab1cc27cd6b1e5ec42faf848fea5fc3.tar.gz rust-efca32e23ab1cc27cd6b1e5ec42faf848fea5fc3.zip | |
Rename some `OwnerId` fields.
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
Diffstat (limited to 'clippy_lints/src/same_name_method.rs')
| -rw-r--r-- | clippy_lints/src/same_name_method.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/same_name_method.rs b/clippy_lints/src/same_name_method.rs index 4249063d2d4..caab5851baf 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.def_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, |
