@@ -249,15 +249,15 @@ fn compare_method_predicate_entailment<'tcx>(
249
249
let unnormalized_impl_sig = infcx. replace_bound_vars_with_fresh_vars (
250
250
impl_m_span,
251
251
infer:: HigherRankedType ,
252
- tcx. fn_sig ( impl_m. def_id ) ,
252
+ tcx. fn_sig ( impl_m. def_id ) . subst_identity ( ) ,
253
253
) ;
254
254
let unnormalized_impl_fty = tcx. mk_fn_ptr ( ty:: Binder :: dummy ( unnormalized_impl_sig) ) ;
255
255
256
256
let norm_cause = ObligationCause :: misc ( impl_m_span, impl_m_def_id) ;
257
257
let impl_sig = ocx. normalize ( & norm_cause, param_env, unnormalized_impl_sig) ;
258
258
debug ! ( "compare_impl_method: impl_fty={:?}" , impl_sig) ;
259
259
260
- let trait_sig = tcx. bound_fn_sig ( trait_m. def_id ) . subst ( tcx, trait_to_placeholder_substs) ;
260
+ let trait_sig = tcx. fn_sig ( trait_m. def_id ) . subst ( tcx, trait_to_placeholder_substs) ;
261
261
let trait_sig = tcx. liberate_late_bound_regions ( impl_m. def_id , trait_sig) ;
262
262
263
263
// Next, add all inputs and output as well-formed tys. Importantly,
@@ -422,8 +422,8 @@ fn extract_bad_args_for_implies_lint<'tcx>(
422
422
423
423
// Map late-bound regions from trait to impl, so the names are right.
424
424
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. fn_sig ( trait_m. def_id ) . skip_binder ( ) . bound_vars ( ) ,
426
+ tcx. fn_sig ( impl_m. def_id ) . skip_binder ( ) . bound_vars ( ) ,
427
427
)
428
428
. filter_map ( |( impl_bv, trait_bv) | {
429
429
if let ty:: BoundVariableKind :: Region ( impl_bv) = impl_bv
@@ -540,7 +540,7 @@ fn compare_asyncness<'tcx>(
540
540
trait_item_span : Option < Span > ,
541
541
) -> Result < ( ) , ErrorGuaranteed > {
542
542
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. fn_sig ( impl_m. def_id ) . skip_binder ( ) . skip_binder ( ) . output ( ) . kind ( ) {
544
544
ty:: Alias ( ty:: Opaque , ..) => {
545
545
// allow both `async fn foo()` and `fn foo() -> impl Future`
546
546
}
@@ -643,7 +643,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
643
643
infcx. replace_bound_vars_with_fresh_vars (
644
644
return_span,
645
645
infer:: HigherRankedType ,
646
- tcx. fn_sig ( impl_m. def_id ) ,
646
+ tcx. fn_sig ( impl_m. def_id ) . subst_identity ( ) ,
647
647
) ,
648
648
) ;
649
649
impl_sig. error_reported ( ) ?;
@@ -657,7 +657,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
657
657
let unnormalized_trait_sig = tcx
658
658
. liberate_late_bound_regions (
659
659
impl_m. def_id ,
660
- tcx. bound_fn_sig ( trait_m. def_id ) . subst ( tcx, trait_to_placeholder_substs) ,
660
+ tcx. fn_sig ( trait_m. def_id ) . subst ( tcx, trait_to_placeholder_substs) ,
661
661
)
662
662
. fold_with ( & mut collector) ;
663
663
let trait_sig = ocx. normalize ( & norm_cause, param_env, unnormalized_trait_sig) ;
@@ -1117,7 +1117,7 @@ fn compare_self_type<'tcx>(
1117
1117
ty:: ImplContainer => impl_trait_ref. self_ty ( ) ,
1118
1118
ty:: TraitContainer => tcx. types . self_param ,
1119
1119
} ;
1120
- let self_arg_ty = tcx. fn_sig ( method. def_id ) . input ( 0 ) ;
1120
+ let self_arg_ty = tcx. fn_sig ( method. def_id ) . subst_identity ( ) . input ( 0 ) ;
1121
1121
let param_env = ty:: ParamEnv :: reveal_all ( ) ;
1122
1122
1123
1123
let infcx = tcx. infer_ctxt ( ) . build ( ) ;
@@ -1350,8 +1350,8 @@ fn compare_number_of_method_arguments<'tcx>(
1350
1350
) -> Result < ( ) , ErrorGuaranteed > {
1351
1351
let impl_m_fty = tcx. fn_sig ( impl_m. def_id ) ;
1352
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 ( ) ;
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 ( ) ;
1355
1355
1356
1356
if trait_number_args != impl_number_args {
1357
1357
let trait_span = trait_m
0 commit comments