@@ -28,8 +28,8 @@ use rustc_middle::{
28
28
metadata:: ModChild ,
29
29
ty:: {
30
30
subst:: { InternalSubsts , Subst } ,
31
- AssocItem , GenericParamDef , GenericParamDefKind , Generics , TraitRef , Ty , TyCtxt , TyKind ,
32
- TypeAndMut , Visibility ,
31
+ AssocItem , EarlyBinder , GenericParamDef , GenericParamDefKind , Generics , TraitRef , Ty ,
32
+ TyCtxt , TyKind , TypeAndMut , Visibility ,
33
33
Visibility :: Public ,
34
34
} ,
35
35
} ;
@@ -970,12 +970,10 @@ fn cmp_types<'tcx>(
970
970
} else {
971
971
compcx. compute_target_default_substs ( target_def_id)
972
972
} ;
973
- let target = target. subst ( infcx. tcx , target_substs) ;
973
+ let target = EarlyBinder ( target) . subst ( infcx. tcx , target_substs) ;
974
974
975
- let target_param_env = infcx
976
- . tcx
977
- . param_env ( target_def_id)
978
- . subst ( infcx. tcx , target_substs) ;
975
+ let target_param_env =
976
+ EarlyBinder ( infcx. tcx . param_env ( target_def_id) ) . subst ( infcx. tcx , target_substs) ;
979
977
980
978
if let Some ( err) =
981
979
compcx. check_type_error ( tcx, target_def_id, target_param_env, orig, target)
@@ -1255,10 +1253,8 @@ fn match_inherent_impl<'tcx>(
1255
1253
. translate_item_type ( orig_impl_def_id, infcx. tcx . type_of ( orig_impl_def_id) ) ;
1256
1254
1257
1255
let target_substs = compcx. compute_target_infer_substs ( target_item_def_id) ;
1258
- let target_self = infcx
1259
- . tcx
1260
- . type_of ( target_impl_def_id)
1261
- . subst ( infcx. tcx , target_substs) ;
1256
+ let target_self =
1257
+ EarlyBinder ( infcx. tcx . type_of ( target_impl_def_id) ) . subst ( infcx. tcx , target_substs) ;
1262
1258
1263
1259
let target_param_env = infcx. tcx . param_env ( target_impl_def_id) ;
1264
1260
@@ -1316,7 +1312,7 @@ fn match_inherent_impl<'tcx>(
1316
1312
let orig = compcx
1317
1313
. forward_trans
1318
1314
. translate_item_type ( orig_item_def_id, orig) ;
1319
- let target = target. subst ( infcx. tcx , target_substs) ;
1315
+ let target = EarlyBinder ( target) . subst ( infcx. tcx , target_substs) ;
1320
1316
1321
1317
let error =
1322
1318
compcx. check_type_error ( tcx, target_item_def_id, target_param_env, orig, target) ;
0 commit comments