@@ -28,7 +28,7 @@ use crate::traits;
28
28
use crate :: traits:: { Clause , Clauses , GoalKind , Goal , Goals } ;
29
29
use crate :: ty:: { self , DefIdTree , Ty , TypeAndMut } ;
30
30
use 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 } ;
32
32
use crate :: ty:: { PolyFnSig , InferTy , ParamTy , ProjectionTy , ExistentialPredicate , Predicate } ;
33
33
use crate :: ty:: RegionKind ;
34
34
use crate :: ty:: { TyVar , TyVid , IntVar , IntVid , FloatVar , FloatVid , ConstVid } ;
@@ -126,7 +126,7 @@ pub struct CtxtInterners<'tcx> {
126
126
goal : InternedSet < ' tcx , GoalKind < ' tcx > > ,
127
127
goal_list : InternedSet < ' tcx , List < Goal < ' tcx > > > ,
128
128
projs : InternedSet < ' tcx , List < ProjectionKind < ' tcx > > > ,
129
- lazy_const : InternedSet < ' tcx , LazyConst < ' tcx > > ,
129
+ const_ : InternedSet < ' tcx , Const < ' tcx > > ,
130
130
}
131
131
132
132
impl < ' gcx : ' tcx , ' tcx > CtxtInterners < ' tcx > {
@@ -144,7 +144,7 @@ impl<'gcx: 'tcx, 'tcx> CtxtInterners<'tcx> {
144
144
goal : Default :: default ( ) ,
145
145
goal_list : Default :: default ( ) ,
146
146
projs : Default :: default ( ) ,
147
- lazy_const : Default :: default ( ) ,
147
+ const_ : Default :: default ( ) ,
148
148
}
149
149
}
150
150
@@ -874,14 +874,11 @@ impl CanonicalUserType<'gcx> {
874
874
_ => false ,
875
875
} ,
876
876
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) ) => {
882
879
// 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
885
882
}
886
883
_ => false ,
887
884
} ,
@@ -1788,7 +1785,7 @@ macro_rules! nop_list_lift {
1788
1785
nop_lift ! { Ty <' a> => Ty <' tcx>}
1789
1786
nop_lift ! { Region <' a> => Region <' tcx>}
1790
1787
nop_lift ! { Goal <' a> => Goal <' tcx>}
1791
- nop_lift ! { & ' a LazyConst <' a> => & ' tcx LazyConst <' tcx>}
1788
+ nop_lift ! { & ' a Const <' a> => & ' tcx Const <' tcx>}
1792
1789
1793
1790
nop_list_lift ! { Goal <' a> => Goal <' tcx>}
1794
1791
nop_list_lift ! { Clause <' a> => Clause <' tcx>}
@@ -2274,12 +2271,6 @@ impl<'tcx: 'lcx, 'lcx> Borrow<GoalKind<'lcx>> for Interned<'tcx, GoalKind<'tcx>>
2274
2271
}
2275
2272
}
2276
2273
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
-
2283
2274
impl < ' tcx : ' lcx , ' lcx > Borrow < [ ExistentialPredicate < ' lcx > ] >
2284
2275
for Interned < ' tcx , List < ExistentialPredicate < ' tcx > > > {
2285
2276
fn borrow < ' a > ( & ' a self ) -> & ' a [ ExistentialPredicate < ' lcx > ] {
@@ -2387,7 +2378,7 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
2387
2378
direct_interners ! ( ' tcx,
2388
2379
region: mk_region( |r: & RegionKind | r. keep_in_local_tcx( ) ) -> RegionKind ,
2389
2380
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>
2391
2382
) ;
2392
2383
2393
2384
macro_rules! slice_interners {
@@ -2575,8 +2566,8 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2575
2566
2576
2567
#[ inline]
2577
2568
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)
2580
2571
) ) )
2581
2572
}
2582
2573
@@ -2670,11 +2661,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2670
2661
}
2671
2662
2672
2663
#[ 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 {
2675
2666
val : ConstValue :: Infer ( InferConst :: Var ( v) ) ,
2676
2667
ty,
2677
- } ) )
2668
+ } )
2678
2669
}
2679
2670
2680
2671
#[ inline]
@@ -2705,11 +2696,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2705
2696
index : u32 ,
2706
2697
name : InternedString ,
2707
2698
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 {
2710
2701
val : ConstValue :: Param ( ParamConst { index, name } ) ,
2711
2702
ty,
2712
- } ) )
2703
+ } )
2713
2704
}
2714
2705
2715
2706
#[ inline]
0 commit comments