@@ -61,7 +61,7 @@ mod zst_offset;
6161
6262use bind_instead_of_map:: BindInsteadOfMap ;
6363use clippy_utils:: diagnostics:: { span_lint, span_lint_and_help} ;
64- use clippy_utils:: ty:: { contains_adt , contains_ty, implements_trait, is_copy, is_type_diagnostic_item} ;
64+ use clippy_utils:: ty:: { contains_adt_constructor , contains_ty, implements_trait, is_copy, is_type_diagnostic_item} ;
6565use clippy_utils:: { contains_return, get_trait_def_id, in_macro, iter_input_pats, method_calls, paths, return_ty} ;
6666use if_chain:: if_chain;
6767use rustc_hir as hir;
@@ -1917,7 +1917,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
19171917
19181918 // walk the return type and check for Self (this does not check associated types)
19191919 if let Some ( self_adt) = self_ty. ty_adt_def ( ) {
1920- if contains_adt ( ret_ty, self_adt) {
1920+ if contains_adt_constructor ( ret_ty, self_adt) {
19211921 return ;
19221922 }
19231923 } else if contains_ty ( ret_ty, self_ty) {
@@ -1931,7 +1931,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
19311931 if let ty:: PredicateKind :: Projection ( projection_predicate) = predicate. kind ( ) . skip_binder ( ) {
19321932 // walk the associated type and check for Self
19331933 if let Some ( self_adt) = self_ty. ty_adt_def ( ) {
1934- if contains_adt ( projection_predicate. ty , self_adt) {
1934+ if contains_adt_constructor ( projection_predicate. ty , self_adt) {
19351935 return ;
19361936 }
19371937 } else if contains_ty ( projection_predicate. ty , self_ty) {
0 commit comments