@@ -32,7 +32,7 @@ use rustc_middle::traits::select::OverflowError;
32
32
use rustc_middle:: ty:: fold:: { TypeFoldable , TypeFolder , TypeSuperFoldable } ;
33
33
use rustc_middle:: ty:: subst:: Subst ;
34
34
use 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 } ;
36
36
use rustc_span:: symbol:: sym;
37
37
38
38
use std:: collections:: BTreeMap ;
@@ -2005,16 +2005,16 @@ fn confirm_impl_candidate<'cx, 'tcx>(
2005
2005
let substs = obligation. predicate . substs . rebase_onto ( tcx, trait_def_id, substs) ;
2006
2006
let substs =
2007
2007
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 ) ;
2009
2009
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 {
2011
2011
let identity_substs =
2012
2012
crate :: traits:: InternalSubsts :: identity_for_item ( tcx, assoc_ty. item . def_id ) ;
2013
2013
let did = ty:: WithOptConstParam :: unknown ( assoc_ty. item . def_id ) ;
2014
2014
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 ( ) )
2016
2016
} else {
2017
- ty. into ( )
2017
+ ty. map_bound ( |ty| ty . into ( ) )
2018
2018
} ;
2019
2019
if substs. len ( ) != tcx. generics_of ( assoc_ty. item . def_id ) . count ( ) {
2020
2020
let err = tcx. ty_error_with_message (
@@ -2024,7 +2024,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
2024
2024
Progress { term : err. into ( ) , obligations : nested }
2025
2025
} else {
2026
2026
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 }
2028
2028
}
2029
2029
}
2030
2030
0 commit comments