@@ -32,7 +32,7 @@ use rustc_middle::traits::select::OverflowError;
3232use rustc_middle:: ty:: fold:: { TypeFoldable , TypeFolder , TypeSuperFoldable } ;
3333use rustc_middle:: ty:: subst:: Subst ;
3434use rustc_middle:: ty:: visit:: { MaxUniverse , TypeVisitable } ;
35- use rustc_middle:: ty:: { self , EarlyBinder , Term , ToPredicate , Ty , TyCtxt } ;
35+ use rustc_middle:: ty:: { self , Term , ToPredicate , Ty , TyCtxt } ;
3636use rustc_span:: symbol:: sym;
3737
3838use std:: collections:: BTreeMap ;
@@ -2005,16 +2005,16 @@ fn confirm_impl_candidate<'cx, 'tcx>(
20052005 let substs = obligation. predicate . substs . rebase_onto ( tcx, trait_def_id, substs) ;
20062006 let substs =
20072007 translate_substs ( selcx. infcx ( ) , param_env, impl_def_id, substs, assoc_ty. defining_node ) ;
2008- let ty = tcx. type_of ( assoc_ty. item . def_id ) ;
2008+ let ty = tcx. bound_type_of ( assoc_ty. item . def_id ) ;
20092009 let is_const = matches ! ( tcx. def_kind( assoc_ty. item. def_id) , DefKind :: AssocConst ) ;
2010- let term: ty:: Term < ' tcx > = if is_const {
2010+ let term: ty:: EarlyBinder < ty :: Term < ' tcx > > = if is_const {
20112011 let identity_substs =
20122012 crate :: traits:: InternalSubsts :: identity_for_item ( tcx, assoc_ty. item . def_id ) ;
20132013 let did = ty:: WithOptConstParam :: unknown ( assoc_ty. item . def_id ) ;
20142014 let kind = ty:: ConstKind :: Unevaluated ( ty:: Unevaluated :: new ( did, identity_substs) ) ;
2015- tcx. mk_const ( ty:: ConstS { ty, kind } ) . into ( )
2015+ ty . map_bound ( |ty| tcx. mk_const ( ty:: ConstS { ty, kind } ) . into ( ) )
20162016 } else {
2017- ty. into ( )
2017+ ty. map_bound ( |ty| ty . into ( ) )
20182018 } ;
20192019 if substs. len ( ) != tcx. generics_of ( assoc_ty. item . def_id ) . count ( ) {
20202020 let err = tcx. ty_error_with_message (
@@ -2024,7 +2024,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
20242024 Progress { term : err. into ( ) , obligations : nested }
20252025 } else {
20262026 assoc_ty_own_obligations ( selcx, obligation, & mut nested) ;
2027- Progress { term : EarlyBinder ( term) . subst ( tcx, substs) , obligations : nested }
2027+ Progress { term : term. subst ( tcx, substs) , obligations : nested }
20282028 }
20292029}
20302030
0 commit comments