From d7ddb2abba435aae10d4357ae299876795749265 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Sat, 28 Jul 2018 10:42:21 +0200 Subject: [PATCH] Add `use_self` comment --- clippy_lints/src/use_self.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index 8c633423cf6..79da4c7d288 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -130,6 +130,10 @@ fn check_trait_method_impl_decl<'a, 'tcx: 'a>( None }; + // `impl_decl_ty` (of type `hir::Ty`) represents the type declared in the signature. + // `impl_ty` (of type `ty:TyS`) is the concrete type that the compiler has determined for + // that declaration. We use `impl_decl_ty` to see if the type was declared as `Self` + // and use `impl_ty` to check its concrete type. for (impl_decl_ty, (impl_ty, trait_ty)) in impl_decl.inputs.iter().chain(output_ty).zip( impl_method_sig .inputs_and_output -- 2.44.0