@@ -28,7 +28,7 @@ use crate::traits;
2828use crate :: traits:: { Clause , Clauses , GoalKind , Goal , Goals } ;
2929use crate :: ty:: { self , DefIdTree , Ty , TypeAndMut } ;
3030use crate :: ty:: { TyS , TyKind , List } ;
31- use crate :: ty:: { AdtKind , AdtDef , ClosureSubsts , GeneratorSubsts , Region , Const , LazyConst } ;
31+ use crate :: ty:: { AdtKind , AdtDef , ClosureSubsts , GeneratorSubsts , Region , Const } ;
3232use crate :: ty:: { PolyFnSig , InferTy , ParamTy , ProjectionTy , ExistentialPredicate , Predicate } ;
3333use crate :: ty:: RegionKind ;
3434use crate :: ty:: { TyVar , TyVid , IntVar , IntVid , FloatVar , FloatVid , ConstVid } ;
@@ -126,7 +126,7 @@ pub struct CtxtInterners<'tcx> {
126126 goal : InternedSet < ' tcx , GoalKind < ' tcx > > ,
127127 goal_list : InternedSet < ' tcx , List < Goal < ' tcx > > > ,
128128 projs : InternedSet < ' tcx , List < ProjectionKind < ' tcx > > > ,
129- lazy_const : InternedSet < ' tcx , LazyConst < ' tcx > > ,
129+ const_ : InternedSet < ' tcx , Const < ' tcx > > ,
130130}
131131
132132impl < ' gcx : ' tcx , ' tcx > CtxtInterners < ' tcx > {
@@ -144,7 +144,7 @@ impl<'gcx: 'tcx, 'tcx> CtxtInterners<'tcx> {
144144 goal : Default :: default ( ) ,
145145 goal_list : Default :: default ( ) ,
146146 projs : Default :: default ( ) ,
147- lazy_const : Default :: default ( ) ,
147+ const_ : Default :: default ( ) ,
148148 }
149149 }
150150
@@ -874,14 +874,11 @@ impl CanonicalUserType<'gcx> {
874874 _ => false ,
875875 } ,
876876
877- UnpackedKind :: Const ( ct) => match ct {
878- ty:: LazyConst :: Evaluated ( ty:: Const {
879- val : ConstValue :: Infer ( InferConst :: Canonical ( debruijn, b) ) ,
880- ..
881- } ) => {
877+ UnpackedKind :: Const ( ct) => match ct. val {
878+ ConstValue :: Infer ( InferConst :: Canonical ( debruijn, b) ) => {
882879 // We only allow a `ty::INNERMOST` index in substitutions.
883- assert_eq ! ( * debruijn, ty:: INNERMOST ) ;
884- cvar == * b
880+ assert_eq ! ( debruijn, ty:: INNERMOST ) ;
881+ cvar == b
885882 }
886883 _ => false ,
887884 } ,
@@ -1788,7 +1785,7 @@ macro_rules! nop_list_lift {
17881785nop_lift ! { Ty <' a> => Ty <' tcx>}
17891786nop_lift ! { Region <' a> => Region <' tcx>}
17901787nop_lift ! { Goal <' a> => Goal <' tcx>}
1791- nop_lift ! { & ' a LazyConst <' a> => & ' tcx LazyConst <' tcx>}
1788+ nop_lift ! { & ' a Const <' a> => & ' tcx Const <' tcx>}
17921789
17931790nop_list_lift ! { Goal <' a> => Goal <' tcx>}
17941791nop_list_lift ! { Clause <' a> => Clause <' tcx>}
@@ -2274,12 +2271,6 @@ impl<'tcx: 'lcx, 'lcx> Borrow<GoalKind<'lcx>> for Interned<'tcx, GoalKind<'tcx>>
22742271 }
22752272}
22762273
2277- impl < ' tcx : ' lcx , ' lcx > Borrow < LazyConst < ' lcx > > for Interned < ' tcx , LazyConst < ' tcx > > {
2278- fn borrow < ' a > ( & ' a self ) -> & ' a LazyConst < ' lcx > {
2279- & self . 0
2280- }
2281- }
2282-
22832274impl < ' tcx : ' lcx , ' lcx > Borrow < [ ExistentialPredicate < ' lcx > ] >
22842275 for Interned < ' tcx , List < ExistentialPredicate < ' tcx > > > {
22852276 fn borrow < ' a > ( & ' a self ) -> & ' a [ ExistentialPredicate < ' lcx > ] {
@@ -2387,7 +2378,7 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
23872378direct_interners ! ( ' tcx,
23882379 region: mk_region( |r: & RegionKind | r. keep_in_local_tcx( ) ) -> RegionKind ,
23892380 goal: mk_goal( |c: & GoalKind <' _>| keep_local( c) ) -> GoalKind <' tcx>,
2390- lazy_const : mk_lazy_const ( |c: & LazyConst <' _>| keep_local( & c) ) -> LazyConst <' tcx>
2381+ const_ : mk_const ( |c: & Const <' _>| keep_local( & c) ) -> Const <' tcx>
23912382) ;
23922383
23932384macro_rules! slice_interners {
@@ -2575,8 +2566,8 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
25752566
25762567 #[ inline]
25772568 pub fn mk_array ( self , ty : Ty < ' tcx > , n : u64 ) -> Ty < ' tcx > {
2578- self . mk_ty ( Array ( ty, self . mk_lazy_const (
2579- ty:: LazyConst :: Evaluated ( ty :: Const :: from_usize ( self . global_tcx ( ) , n) )
2569+ self . mk_ty ( Array ( ty, self . mk_const (
2570+ ty:: Const :: from_usize ( self . global_tcx ( ) , n)
25802571 ) ) )
25812572 }
25822573
@@ -2670,11 +2661,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
26702661 }
26712662
26722663 #[ inline]
2673- pub fn mk_const_var ( self , v : ConstVid < ' tcx > , ty : Ty < ' tcx > ) -> & ' tcx LazyConst < ' tcx > {
2674- self . mk_lazy_const ( LazyConst :: Evaluated ( ty:: Const {
2664+ pub fn mk_const_var ( self , v : ConstVid < ' tcx > , ty : Ty < ' tcx > ) -> & ' tcx Const < ' tcx > {
2665+ self . mk_const ( ty:: Const {
26752666 val : ConstValue :: Infer ( InferConst :: Var ( v) ) ,
26762667 ty,
2677- } ) )
2668+ } )
26782669 }
26792670
26802671 #[ inline]
@@ -2705,11 +2696,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
27052696 index : u32 ,
27062697 name : InternedString ,
27072698 ty : Ty < ' tcx >
2708- ) -> & ' tcx LazyConst < ' tcx > {
2709- self . mk_lazy_const ( LazyConst :: Evaluated ( ty:: Const {
2699+ ) -> & ' tcx Const < ' tcx > {
2700+ self . mk_const ( ty:: Const {
27102701 val : ConstValue :: Param ( ParamConst { index, name } ) ,
27112702 ty,
2712- } ) )
2703+ } )
27132704 }
27142705
27152706 #[ inline]
0 commit comments