@@ -249,7 +249,7 @@ fn compare_method_predicate_entailment<'tcx>(
249249 let unnormalized_impl_sig = infcx. replace_bound_vars_with_fresh_vars (
250250 impl_m_span,
251251 infer:: HigherRankedType ,
252- tcx. fn_sig ( impl_m. def_id ) ,
252+ tcx. bound_fn_sig ( impl_m. def_id ) . subst_identity ( ) ,
253253 ) ;
254254 let unnormalized_impl_fty = tcx. mk_fn_ptr ( ty:: Binder :: dummy ( unnormalized_impl_sig) ) ;
255255
@@ -422,8 +422,8 @@ fn extract_bad_args_for_implies_lint<'tcx>(
422422
423423 // Map late-bound regions from trait to impl, so the names are right.
424424 let mapping = std:: iter:: zip (
425- tcx. fn_sig ( trait_m. def_id ) . bound_vars ( ) ,
426- tcx. fn_sig ( impl_m. def_id ) . bound_vars ( ) ,
425+ tcx. bound_fn_sig ( trait_m. def_id ) . subst_identity ( ) . bound_vars ( ) ,
426+ tcx. bound_fn_sig ( impl_m. def_id ) . subst_identity ( ) . bound_vars ( ) ,
427427 )
428428 . filter_map ( |( impl_bv, trait_bv) | {
429429 if let ty:: BoundVariableKind :: Region ( impl_bv) = impl_bv
@@ -540,7 +540,7 @@ fn compare_asyncness<'tcx>(
540540 trait_item_span : Option < Span > ,
541541) -> Result < ( ) , ErrorGuaranteed > {
542542 if tcx. asyncness ( trait_m. def_id ) == hir:: IsAsync :: Async {
543- match tcx. fn_sig ( impl_m. def_id ) . skip_binder ( ) . output ( ) . kind ( ) {
543+ match tcx. bound_fn_sig ( impl_m. def_id ) . subst_identity ( ) . skip_binder ( ) . output ( ) . kind ( ) {
544544 ty:: Alias ( ty:: Opaque , ..) => {
545545 // allow both `async fn foo()` and `fn foo() -> impl Future`
546546 }
@@ -643,7 +643,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
643643 infcx. replace_bound_vars_with_fresh_vars (
644644 return_span,
645645 infer:: HigherRankedType ,
646- tcx. fn_sig ( impl_m. def_id ) ,
646+ tcx. bound_fn_sig ( impl_m. def_id ) . subst_identity ( ) ,
647647 ) ,
648648 ) ;
649649 impl_sig. error_reported ( ) ?;
@@ -1117,7 +1117,7 @@ fn compare_self_type<'tcx>(
11171117 ty:: ImplContainer => impl_trait_ref. self_ty ( ) ,
11181118 ty:: TraitContainer => tcx. types . self_param ,
11191119 } ;
1120- let self_arg_ty = tcx. fn_sig ( method. def_id ) . input ( 0 ) ;
1120+ let self_arg_ty = tcx. bound_fn_sig ( method. def_id ) . subst_identity ( ) . input ( 0 ) ;
11211121 let param_env = ty:: ParamEnv :: reveal_all ( ) ;
11221122
11231123 let infcx = tcx. infer_ctxt ( ) . build ( ) ;
@@ -1348,10 +1348,10 @@ fn compare_number_of_method_arguments<'tcx>(
13481348 trait_m : & ty:: AssocItem ,
13491349 trait_item_span : Option < Span > ,
13501350) -> Result < ( ) , ErrorGuaranteed > {
1351- let impl_m_fty = tcx. fn_sig ( impl_m. def_id ) ;
1352- let trait_m_fty = tcx. fn_sig ( trait_m. def_id ) ;
1353- let trait_number_args = trait_m_fty. inputs ( ) . skip_binder ( ) . len ( ) ;
1354- let impl_number_args = impl_m_fty. inputs ( ) . skip_binder ( ) . len ( ) ;
1351+ let impl_m_fty = tcx. bound_fn_sig ( impl_m. def_id ) ;
1352+ let trait_m_fty = tcx. bound_fn_sig ( trait_m. def_id ) ;
1353+ let trait_number_args = trait_m_fty. skip_binder ( ) . inputs ( ) . skip_binder ( ) . len ( ) ;
1354+ let impl_number_args = impl_m_fty. skip_binder ( ) . inputs ( ) . skip_binder ( ) . len ( ) ;
13551355
13561356 if trait_number_args != impl_number_args {
13571357 let trait_span = trait_m
0 commit comments