diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-01-30 20:46:50 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-15 19:32:28 +0100 |
| commit | fc9bc33bbaa595cdfe3e5e5cd37cd96186fc52eb (patch) | |
| tree | c5043320caad5d42bd1cb91d7dd4cf68c7db6fa9 /clippy_lints/src/methods/mod.rs | |
| parent | 2dc65397ee5710c16e077e0ca1e7513c365c10a6 (diff) | |
| download | rust-fc9bc33bbaa595cdfe3e5e5cd37cd96186fc52eb.tar.gz rust-fc9bc33bbaa595cdfe3e5e5cd37cd96186fc52eb.zip | |
Only store a LocalDefId in hir::TraitItem.
Diffstat (limited to 'clippy_lints/src/methods/mod.rs')
| -rw-r--r-- | clippy_lints/src/methods/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index a2104b48b4f..a68775ffb75 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -1791,7 +1791,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods { if let Some(first_arg_ty) = sig.decl.inputs.iter().next(); let first_arg_span = first_arg_ty.span; let first_arg_ty = hir_ty_to_ty(cx.tcx, first_arg_ty); - let self_ty = TraitRef::identity(cx.tcx, item.hir_id.owner.to_def_id()).self_ty(); + let self_ty = TraitRef::identity(cx.tcx, item.def_id.to_def_id()).self_ty(); then { lint_wrong_self_convention(cx, &item.ident.name.as_str(), false, self_ty, first_arg_ty, first_arg_span); @@ -1801,8 +1801,8 @@ impl<'tcx> LateLintPass<'tcx> for Methods { if_chain! { if item.ident.name == sym::new; if let TraitItemKind::Fn(_, _) = item.kind; - let ret_ty = return_ty(cx, item.hir_id); - let self_ty = TraitRef::identity(cx.tcx, item.hir_id.owner.to_def_id()).self_ty(); + let ret_ty = return_ty(cx, item.hir_id()); + let self_ty = TraitRef::identity(cx.tcx, item.def_id.to_def_id()).self_ty(); if !contains_ty(ret_ty, self_ty); then { |
