Skip to content

Commit d7ddb2a

Browse files
author
Michael Wright
committed
Add use_self comment
1 parent 8eeb3fe commit d7ddb2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clippy_lints/src/use_self.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ fn check_trait_method_impl_decl<'a, 'tcx: 'a>(
130130
None
131131
};
132132

133+
// `impl_decl_ty` (of type `hir::Ty`) represents the type declared in the signature.
134+
// `impl_ty` (of type `ty:TyS`) is the concrete type that the compiler has determined for
135+
// that declaration. We use `impl_decl_ty` to see if the type was declared as `Self`
136+
// and use `impl_ty` to check its concrete type.
133137
for (impl_decl_ty, (impl_ty, trait_ty)) in impl_decl.inputs.iter().chain(output_ty).zip(
134138
impl_method_sig
135139
.inputs_and_output

0 commit comments

Comments
 (0)