@@ -2,16 +2,14 @@ use std::borrow::Cow;
22use std:: iter;
33
44use rustc_data_structures:: fx:: FxIndexSet ;
5- use rustc_errors:: {
6- Applicability , Applicability , E0053 , E0053 , struct_span_code_err, struct_span_code_err,
7- } ;
5+ use rustc_errors:: { Applicability , E0053 , E0053 , struct_span_code_err, struct_span_code_err} ;
86use rustc_hir:: def_id:: { DefId , LocalDefId } ;
97use rustc_hir:: { self as hir, self as hir, HirId , HirId , ItemKind , ItemKind } ;
108use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
119use rustc_infer:: traits:: { ObligationCause , ObligationCauseCode } ;
1210use rustc_middle:: ty;
1311use rustc_middle:: ty:: TyCtxt ;
14- use rustc_middle:: ty:: error:: { ExpectedFound , ExpectedFound , TypeError , TypeError } ;
12+ use rustc_middle:: ty:: error:: { ExpectedFound , TypeError , TypeError } ;
1513use rustc_span:: { ErrorGuaranteed , Ident , Span } ;
1614use rustc_trait_selection:: error_reporting:: InferCtxtErrorExt ;
1715use rustc_trait_selection:: regions:: InferCtxtRegionExt ;
@@ -54,11 +52,13 @@ pub(crate) fn compare_eii_function_types<'tcx>(
5452 // type.
5553
5654 let wf_tys = FxIndexSet :: default ( ) ;
57-
5855 let external_impl_sig = infcx. instantiate_binder_with_fresh_vars (
5956 external_impl_span,
6057 infer:: HigherRankedType ,
61- tcx. fn_sig ( external_impl) . instantiate_identity ( ) ,
58+ tcx. fn_sig ( external_impl) . instantiate (
59+ tcx,
60+ infcx. fresh_args_for_item ( external_impl_span, external_impl. to_def_id ( ) ) ,
61+ ) ,
6262 ) ;
6363
6464 let norm_cause = ObligationCause :: misc ( external_impl_span, external_impl) ;
0 commit comments