@@ -61,7 +61,7 @@ mod zst_offset;
61
61
62
62
use bind_instead_of_map:: BindInsteadOfMap ;
63
63
use 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} ;
65
65
use clippy_utils:: { contains_return, get_trait_def_id, in_macro, iter_input_pats, method_calls, paths, return_ty} ;
66
66
use if_chain:: if_chain;
67
67
use rustc_hir as hir;
@@ -1917,7 +1917,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1917
1917
1918
1918
// walk the return type and check for Self (this does not check associated types)
1919
1919
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) {
1921
1921
return ;
1922
1922
}
1923
1923
} else if contains_ty ( ret_ty, self_ty) {
@@ -1931,7 +1931,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1931
1931
if let ty:: PredicateKind :: Projection ( projection_predicate) = predicate. kind ( ) . skip_binder ( ) {
1932
1932
// walk the associated type and check for Self
1933
1933
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) {
1935
1935
return ;
1936
1936
}
1937
1937
} else if contains_ty ( projection_predicate. ty , self_ty) {
0 commit comments