Skip to content

Commit efca32e

Browse files
committed
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.
1 parent 26eeeee commit efca32e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+115
-115
lines changed

clippy_lints/src/copy_iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<'tcx> LateLintPass<'tcx> for CopyIterator {
4343
of_trait: Some(ref trait_ref),
4444
..
4545
}) = item.kind;
46-
let ty = cx.tcx.type_of(item.def_id);
46+
let ty = cx.tcx.type_of(item.owner_id);
4747
if is_copy(cx, ty);
4848
if let Some(trait_id) = trait_ref.trait_def_id();
4949
if cx.tcx.is_diagnostic_item(sym::Iterator, trait_id);

clippy_lints/src/default_union_representation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultUnionRepresentation {
6161
None,
6262
&format!(
6363
"consider annotating `{}` with `#[repr(C)]` to explicitly specify memory layout",
64-
cx.tcx.def_path_str(item.def_id.to_def_id())
64+
cx.tcx.def_path_str(item.owner_id.to_def_id())
6565
),
6666
);
6767
}

clippy_lints/src/dereference.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -715,47 +715,47 @@ fn walk_parents<'tcx>(
715715
},
716716
Node::Item(&Item {
717717
kind: ItemKind::Static(..) | ItemKind::Const(..),
718-
def_id,
718+
owner_id,
719719
span,
720720
..
721721
})
722722
| Node::TraitItem(&TraitItem {
723723
kind: TraitItemKind::Const(..),
724-
def_id,
724+
owner_id,
725725
span,
726726
..
727727
})
728728
| Node::ImplItem(&ImplItem {
729729
kind: ImplItemKind::Const(..),
730-
def_id,
730+
owner_id,
731731
span,
732732
..
733733
}) if span.ctxt() == ctxt => {
734-
let ty = cx.tcx.type_of(def_id.def_id);
734+
let ty = cx.tcx.type_of(owner_id.def_id);
735735
Some(ty_auto_deref_stability(cx, ty, precedence).position_for_result(cx))
736736
},
737737

738738
Node::Item(&Item {
739739
kind: ItemKind::Fn(..),
740-
def_id,
740+
owner_id,
741741
span,
742742
..
743743
})
744744
| Node::TraitItem(&TraitItem {
745745
kind: TraitItemKind::Fn(..),
746-
def_id,
746+
owner_id,
747747
span,
748748
..
749749
})
750750
| Node::ImplItem(&ImplItem {
751751
kind: ImplItemKind::Fn(..),
752-
def_id,
752+
owner_id,
753753
span,
754754
..
755755
}) if span.ctxt() == ctxt => {
756756
let output = cx
757757
.tcx
758-
.erase_late_bound_regions(cx.tcx.fn_sig(def_id.to_def_id()).output());
758+
.erase_late_bound_regions(cx.tcx.fn_sig(owner_id.to_def_id()).output());
759759
Some(ty_auto_deref_stability(cx, output, precedence).position_for_result(cx))
760760
},
761761

clippy_lints/src/derivable_impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
7070
self_ty,
7171
..
7272
}) = item.kind;
73-
if !cx.tcx.has_attr(item.def_id.to_def_id(), sym::automatically_derived);
73+
if !cx.tcx.has_attr(item.owner_id.to_def_id(), sym::automatically_derived);
7474
if !item.span.from_expansion();
7575
if let Some(def_id) = trait_ref.trait_def_id();
7676
if cx.tcx.is_diagnostic_item(sym::Default, def_id);
7777
if let impl_item_hir = child.id.hir_id();
7878
if let Some(Node::ImplItem(impl_item)) = cx.tcx.hir().find(impl_item_hir);
7979
if let ImplItemKind::Fn(_, b) = &impl_item.kind;
8080
if let Body { value: func_expr, .. } = cx.tcx.hir().body(*b);
81-
if let Some(adt_def) = cx.tcx.type_of(item.def_id).ty_adt_def();
81+
if let Some(adt_def) = cx.tcx.type_of(item.owner_id).ty_adt_def();
8282
if let attrs = cx.tcx.hir().attrs(item.hir_id());
8383
if !attrs.iter().any(|attr| attr.doc_str().is_some());
8484
if let child_attrs = cx.tcx.hir().attrs(impl_item_hir);

clippy_lints/src/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ impl<'tcx> LateLintPass<'tcx> for Derive {
210210
..
211211
}) = item.kind
212212
{
213-
let ty = cx.tcx.type_of(item.def_id);
214-
let is_automatically_derived = cx.tcx.has_attr(item.def_id.to_def_id(), sym::automatically_derived);
213+
let ty = cx.tcx.type_of(item.owner_id);
214+
let is_automatically_derived = cx.tcx.has_attr(item.owner_id.to_def_id(), sym::automatically_derived);
215215

216216
check_hash_peq(cx, item.span, trait_ref, ty, is_automatically_derived);
217217
check_ord_partial_ord(cx, item.span, trait_ref, ty, is_automatically_derived);

clippy_lints/src/doc.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,17 @@ impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
257257
let headers = check_attrs(cx, &self.valid_idents, attrs);
258258
match item.kind {
259259
hir::ItemKind::Fn(ref sig, _, body_id) => {
260-
if !(is_entrypoint_fn(cx, item.def_id.to_def_id()) || in_external_macro(cx.tcx.sess, item.span)) {
260+
if !(is_entrypoint_fn(cx, item.owner_id.to_def_id()) || in_external_macro(cx.tcx.sess, item.span)) {
261261
let body = cx.tcx.hir().body(body_id);
262262
let mut fpu = FindPanicUnwrap {
263263
cx,
264-
typeck_results: cx.tcx.typeck(item.def_id.def_id),
264+
typeck_results: cx.tcx.typeck(item.owner_id.def_id),
265265
panic_span: None,
266266
};
267267
fpu.visit_expr(body.value);
268268
lint_for_missing_headers(
269269
cx,
270-
item.def_id.def_id,
270+
item.owner_id.def_id,
271271
item.span,
272272
sig,
273273
headers,
@@ -304,7 +304,7 @@ impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
304304
let headers = check_attrs(cx, &self.valid_idents, attrs);
305305
if let hir::TraitItemKind::Fn(ref sig, ..) = item.kind {
306306
if !in_external_macro(cx.tcx.sess, item.span) {
307-
lint_for_missing_headers(cx, item.def_id.def_id, item.span, sig, headers, None, None);
307+
lint_for_missing_headers(cx, item.owner_id.def_id, item.span, sig, headers, None, None);
308308
}
309309
}
310310
}
@@ -319,13 +319,13 @@ impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
319319
let body = cx.tcx.hir().body(body_id);
320320
let mut fpu = FindPanicUnwrap {
321321
cx,
322-
typeck_results: cx.tcx.typeck(item.def_id.def_id),
322+
typeck_results: cx.tcx.typeck(item.owner_id.def_id),
323323
panic_span: None,
324324
};
325325
fpu.visit_expr(body.value);
326326
lint_for_missing_headers(
327327
cx,
328-
item.def_id.def_id,
328+
item.owner_id.def_id,
329329
item.span,
330330
sig,
331331
headers,

clippy_lints/src/empty_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for EmptyEnum {
4949
}
5050

5151
if let ItemKind::Enum(..) = item.kind {
52-
let ty = cx.tcx.type_of(item.def_id);
52+
let ty = cx.tcx.type_of(item.owner_id);
5353
let adt = ty.ty_adt_def().expect("already checked whether this is an enum");
5454
if adt.variants().is_empty() {
5555
span_lint_and_help(

clippy_lints/src/enum_variants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl LateLintPass<'_> for EnumVariantNames {
265265
}
266266
// The `module_name_repetitions` lint should only trigger if the item has the module in its
267267
// name. Having the same name is accepted.
268-
if cx.tcx.visibility(item.def_id).is_public() && item_camel.len() > mod_camel.len() {
268+
if cx.tcx.visibility(item.owner_id).is_public() && item_camel.len() > mod_camel.len() {
269269
let matching = count_match_start(mod_camel, &item_camel);
270270
let rmatching = count_match_end(mod_camel, &item_camel);
271271
let nchars = mod_camel.chars().count();
@@ -296,7 +296,7 @@ impl LateLintPass<'_> for EnumVariantNames {
296296
}
297297
}
298298
if let ItemKind::Enum(ref def, _) = item.kind {
299-
if !(self.avoid_breaking_exported_api && cx.effective_visibilities.is_exported(item.def_id.def_id)) {
299+
if !(self.avoid_breaking_exported_api && cx.effective_visibilities.is_exported(item.owner_id.def_id)) {
300300
check_variant(cx, self.threshold, def, item_name, item.span);
301301
}
302302
}

clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
8888
// be sure we have `self` parameter in this function
8989
if trait_item.kind == (AssocItemKind::Fn { has_self: true }) {
9090
trait_self_ty = Some(
91-
TraitRef::identity(cx.tcx, trait_item.id.def_id.to_def_id())
91+
TraitRef::identity(cx.tcx, trait_item.id.owner_id.to_def_id())
9292
.self_ty()
9393
.skip_binder(),
9494
);

clippy_lints/src/exhaustive_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl LateLintPass<'_> for ExhaustiveItems {
7373
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
7474
if_chain! {
7575
if let ItemKind::Enum(..) | ItemKind::Struct(..) = item.kind;
76-
if cx.effective_visibilities.is_exported(item.def_id.def_id);
76+
if cx.effective_visibilities.is_exported(item.owner_id.def_id);
7777
let attrs = cx.tcx.hir().attrs(item.hir_id());
7878
if !attrs.iter().any(|a| a.has_name(sym::non_exhaustive));
7979
then {

clippy_lints/src/fallible_impl_from.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'tcx> LateLintPass<'tcx> for FallibleImplFrom {
5555
// check for `impl From<???> for ..`
5656
if_chain! {
5757
if let hir::ItemKind::Impl(impl_) = &item.kind;
58-
if let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(item.def_id);
58+
if let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(item.owner_id);
5959
if cx.tcx.is_diagnostic_item(sym::From, impl_trait_ref.def_id);
6060
then {
6161
lint_impl_body(cx, item.span, impl_.items);
@@ -107,7 +107,7 @@ fn lint_impl_body<'tcx>(cx: &LateContext<'tcx>, impl_span: Span, impl_items: &[h
107107
let body = cx.tcx.hir().body(body_id);
108108
let mut fpu = FindPanicUnwrap {
109109
lcx: cx,
110-
typeck_results: cx.tcx.typeck(impl_item.id.def_id.def_id),
110+
typeck_results: cx.tcx.typeck(impl_item.id.owner_id.def_id),
111111
result: Vec::new(),
112112
};
113113
fpu.visit_expr(body.value);

clippy_lints/src/from_over_into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<'tcx> LateLintPass<'tcx> for FromOverInto {
7676
&& let Some(into_trait_seg) = hir_trait_ref.path.segments.last()
7777
// `impl Into<target_ty> for self_ty`
7878
&& let Some(GenericArgs { args: [GenericArg::Type(target_ty)], .. }) = into_trait_seg.args
79-
&& let Some(middle_trait_ref) = cx.tcx.impl_trait_ref(item.def_id)
79+
&& let Some(middle_trait_ref) = cx.tcx.impl_trait_ref(item.owner_id)
8080
&& cx.tcx.is_diagnostic_item(sym::Into, middle_trait_ref.def_id)
8181
{
8282
span_lint_and_then(

clippy_lints/src/functions/must_use.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ use super::{DOUBLE_MUST_USE, MUST_USE_CANDIDATE, MUST_USE_UNIT};
2222

2323
pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
2424
let attrs = cx.tcx.hir().attrs(item.hir_id());
25-
let attr = cx.tcx.get_attr(item.def_id.to_def_id(), sym::must_use);
25+
let attr = cx.tcx.get_attr(item.owner_id.to_def_id(), sym::must_use);
2626
if let hir::ItemKind::Fn(ref sig, _generics, ref body_id) = item.kind {
27-
let is_public = cx.effective_visibilities.is_exported(item.def_id.def_id);
27+
let is_public = cx.effective_visibilities.is_exported(item.owner_id.def_id);
2828
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
2929
if let Some(attr) = attr {
3030
check_needless_must_use(cx, sig.decl, item.hir_id(), item.span, fn_header_span, attr);
@@ -34,7 +34,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
3434
sig.decl,
3535
cx.tcx.hir().body(*body_id),
3636
item.span,
37-
item.def_id.def_id,
37+
item.owner_id.def_id,
3838
item.span.with_hi(sig.decl.output.span().hi()),
3939
"this function could have a `#[must_use]` attribute",
4040
);
@@ -44,20 +44,20 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
4444

4545
pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) {
4646
if let hir::ImplItemKind::Fn(ref sig, ref body_id) = item.kind {
47-
let is_public = cx.effective_visibilities.is_exported(item.def_id.def_id);
47+
let is_public = cx.effective_visibilities.is_exported(item.owner_id.def_id);
4848
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
4949
let attrs = cx.tcx.hir().attrs(item.hir_id());
50-
let attr = cx.tcx.get_attr(item.def_id.to_def_id(), sym::must_use);
50+
let attr = cx.tcx.get_attr(item.owner_id.to_def_id(), sym::must_use);
5151
if let Some(attr) = attr {
5252
check_needless_must_use(cx, sig.decl, item.hir_id(), item.span, fn_header_span, attr);
53-
} else if is_public && !is_proc_macro(cx.sess(), attrs) && trait_ref_of_method(cx, item.def_id.def_id).is_none()
53+
} else if is_public && !is_proc_macro(cx.sess(), attrs) && trait_ref_of_method(cx, item.owner_id.def_id).is_none()
5454
{
5555
check_must_use_candidate(
5656
cx,
5757
sig.decl,
5858
cx.tcx.hir().body(*body_id),
5959
item.span,
60-
item.def_id.def_id,
60+
item.owner_id.def_id,
6161
item.span.with_hi(sig.decl.output.span().hi()),
6262
"this method could have a `#[must_use]` attribute",
6363
);
@@ -67,11 +67,11 @@ pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Imp
6767

6868
pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) {
6969
if let hir::TraitItemKind::Fn(ref sig, ref eid) = item.kind {
70-
let is_public = cx.effective_visibilities.is_exported(item.def_id.def_id);
70+
let is_public = cx.effective_visibilities.is_exported(item.owner_id.def_id);
7171
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
7272

7373
let attrs = cx.tcx.hir().attrs(item.hir_id());
74-
let attr = cx.tcx.get_attr(item.def_id.to_def_id(), sym::must_use);
74+
let attr = cx.tcx.get_attr(item.owner_id.to_def_id(), sym::must_use);
7575
if let Some(attr) = attr {
7676
check_needless_must_use(cx, sig.decl, item.hir_id(), item.span, fn_header_span, attr);
7777
} else if let hir::TraitFn::Provided(eid) = *eid {
@@ -82,7 +82,7 @@ pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Tr
8282
sig.decl,
8383
body,
8484
item.span,
85-
item.def_id.def_id,
85+
item.owner_id.def_id,
8686
item.span.with_hi(sig.decl.output.span().hi()),
8787
"this method could have a `#[must_use]` attribute",
8888
);

clippy_lints/src/functions/not_unsafe_ptr_arg_deref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(super) fn check_fn<'tcx>(
3131
pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) {
3232
if let hir::TraitItemKind::Fn(ref sig, hir::TraitFn::Provided(eid)) = item.kind {
3333
let body = cx.tcx.hir().body(eid);
34-
check_raw_ptr(cx, sig.header.unsafety, sig.decl, body, item.def_id.def_id);
34+
check_raw_ptr(cx, sig.header.unsafety, sig.decl, body, item.owner_id.def_id);
3535
}
3636
}
3737

clippy_lints/src/functions/result.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ fn result_err_ty<'tcx>(
3434

3535
pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &hir::Item<'tcx>, large_err_threshold: u64) {
3636
if let hir::ItemKind::Fn(ref sig, _generics, _) = item.kind
37-
&& let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.def_id.def_id, item.span)
37+
&& let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span)
3838
{
39-
if cx.effective_visibilities.is_exported(item.def_id.def_id) {
39+
if cx.effective_visibilities.is_exported(item.owner_id.def_id) {
4040
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
4141
check_result_unit_err(cx, err_ty, fn_header_span);
4242
}
@@ -47,10 +47,10 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &hir::Item<'tcx>, l
4747
pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &hir::ImplItem<'tcx>, large_err_threshold: u64) {
4848
// Don't lint if method is a trait's implementation, we can't do anything about those
4949
if let hir::ImplItemKind::Fn(ref sig, _) = item.kind
50-
&& let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.def_id.def_id, item.span)
51-
&& trait_ref_of_method(cx, item.def_id.def_id).is_none()
50+
&& let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span)
51+
&& trait_ref_of_method(cx, item.owner_id.def_id).is_none()
5252
{
53-
if cx.effective_visibilities.is_exported(item.def_id.def_id) {
53+
if cx.effective_visibilities.is_exported(item.owner_id.def_id) {
5454
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
5555
check_result_unit_err(cx, err_ty, fn_header_span);
5656
}
@@ -61,8 +61,8 @@ pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &hir::ImplItem
6161
pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &hir::TraitItem<'tcx>, large_err_threshold: u64) {
6262
if let hir::TraitItemKind::Fn(ref sig, _) = item.kind {
6363
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
64-
if let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.def_id.def_id, item.span) {
65-
if cx.effective_visibilities.is_exported(item.def_id.def_id) {
64+
if let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) {
65+
if cx.effective_visibilities.is_exported(item.owner_id.def_id) {
6666
check_result_unit_err(cx, err_ty, fn_header_span);
6767
}
6868
check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold);

clippy_lints/src/implicit_hasher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitHasher {
111111
}
112112
}
113113

114-
if !cx.effective_visibilities.is_exported(item.def_id.def_id) {
114+
if !cx.effective_visibilities.is_exported(item.owner_id.def_id) {
115115
return;
116116
}
117117

clippy_lints/src/inherent_to_string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'tcx> LateLintPass<'tcx> for InherentToString {
108108
if is_type_diagnostic_item(cx, return_ty(cx, impl_item.hir_id()), sym::String);
109109

110110
// Filters instances of to_string which are required by a trait
111-
if trait_ref_of_method(cx, impl_item.def_id.def_id).is_none();
111+
if trait_ref_of_method(cx, impl_item.owner_id.def_id).is_none();
112112

113113
then {
114114
show_lint(cx, impl_item);
@@ -124,7 +124,7 @@ fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) {
124124
.expect("Failed to get trait ID of `Display`!");
125125

126126
// Get the real type of 'self'
127-
let self_type = cx.tcx.fn_sig(item.def_id).input(0);
127+
let self_type = cx.tcx.fn_sig(item.owner_id).input(0);
128128
let self_type = self_type.skip_binder().peel_refs();
129129

130130
// Emit either a warning or an error

clippy_lints/src/iter_not_returning_iterator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'tcx> LateLintPass<'tcx> for IterNotReturningIterator {
4444
let name = item.ident.name.as_str();
4545
if matches!(name, "iter" | "iter_mut") {
4646
if let TraitItemKind::Fn(fn_sig, _) = &item.kind {
47-
check_sig(cx, name, fn_sig, item.def_id.def_id);
47+
check_sig(cx, name, fn_sig, item.owner_id.def_id);
4848
}
4949
}
5050
}
@@ -58,7 +58,7 @@ impl<'tcx> LateLintPass<'tcx> for IterNotReturningIterator {
5858
)
5959
{
6060
if let ImplItemKind::Fn(fn_sig, _) = &item.kind {
61-
check_sig(cx, name, fn_sig, item.def_id.def_id);
61+
check_sig(cx, name, fn_sig, item.owner_id.def_id);
6262
}
6363
}
6464
}

0 commit comments

Comments
 (0)