]> git.lizzy.rs Git - rust.git/commitdiff
Add `use_self` comment
authorMichael Wright <mikerite@lavabit.com>
Sat, 28 Jul 2018 08:42:21 +0000 (10:42 +0200)
committerMichael Wright <mikerite@lavabit.com>
Sat, 28 Jul 2018 08:42:21 +0000 (10:42 +0200)
clippy_lints/src/use_self.rs

index 8c633423cf6cb1c3c263a02cd6238fe1e202b802..79da4c7d288d51afba0f642afa3a6c07a0f63dfb 100644 (file)
@@ -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