@@ -17,8 +17,8 @@ use crate::traits;
17
17
use crate :: ty:: query:: { self , TyCtxtAt } ;
18
18
use crate :: ty:: {
19
19
self , AdtDef , AdtDefData , AdtKind , Binder , BindingMode , BoundVar , CanonicalPolyFnSig ,
20
- ClosureSizeProfileData , Const , ConstS , ConstVid , DefIdTree , FloatTy , FloatVar , FloatVid ,
21
- GenericParamDefKind , InferConst , InferTy , IntTy , IntVar , IntVid , List , ParamConst , ParamTy ,
20
+ ClosureSizeProfileData , Const , ConstS , DefIdTree , FloatTy , FloatVar , FloatVid ,
21
+ GenericParamDefKind , InferTy , IntTy , IntVar , IntVid , List , ParamConst , ParamTy ,
22
22
PolyExistentialPredicate , PolyFnSig , Predicate , PredicateKind , PredicateS , ProjectionTy ,
23
23
Region , RegionKind , ReprOptions , TraitObjectVisitor , Ty , TyKind , TyS , TyVar , TyVid , TypeAndMut ,
24
24
UintTy , Visibility ,
@@ -2602,11 +2602,6 @@ impl<'tcx> TyCtxt<'tcx> {
2602
2602
self . mk_const_internal ( ty:: ConstS { kind : kind. into ( ) , ty } )
2603
2603
}
2604
2604
2605
- #[ inline]
2606
- pub fn mk_const_var ( self , v : ConstVid < ' tcx > , ty : Ty < ' tcx > ) -> Const < ' tcx > {
2607
- self . mk_const ( ty:: ConstKind :: Infer ( InferConst :: Var ( v) ) , ty)
2608
- }
2609
-
2610
2605
#[ inline]
2611
2606
pub fn mk_int_var ( self , v : IntVid ) -> Ty < ' tcx > {
2612
2607
self . mk_ty_infer ( IntVar ( v) )
@@ -2622,30 +2617,23 @@ impl<'tcx> TyCtxt<'tcx> {
2622
2617
self . mk_ty ( Infer ( it) )
2623
2618
}
2624
2619
2625
- #[ inline]
2626
- pub fn mk_const_infer ( self , ic : InferConst < ' tcx > , ty : Ty < ' tcx > ) -> ty:: Const < ' tcx > {
2627
- self . mk_const ( ty:: ConstKind :: Infer ( ic) , ty)
2628
- }
2629
-
2630
2620
#[ inline]
2631
2621
pub fn mk_ty_param ( self , index : u32 , name : Symbol ) -> Ty < ' tcx > {
2632
2622
self . mk_ty ( Param ( ParamTy { index, name } ) )
2633
2623
}
2634
2624
2635
- #[ inline]
2636
- pub fn mk_const_param ( self , index : u32 , name : Symbol , ty : Ty < ' tcx > ) -> Const < ' tcx > {
2637
- self . mk_const ( ty:: ConstKind :: Param ( ParamConst { index, name } ) , ty)
2638
- }
2639
-
2640
2625
pub fn mk_param_from_def ( self , param : & ty:: GenericParamDef ) -> GenericArg < ' tcx > {
2641
2626
match param. kind {
2642
2627
GenericParamDefKind :: Lifetime => {
2643
2628
self . mk_region ( ty:: ReEarlyBound ( param. to_early_bound_region_data ( ) ) ) . into ( )
2644
2629
}
2645
2630
GenericParamDefKind :: Type { .. } => self . mk_ty_param ( param. index , param. name ) . into ( ) ,
2646
- GenericParamDefKind :: Const { .. } => {
2647
- self . mk_const_param ( param. index , param. name , self . type_of ( param. def_id ) ) . into ( )
2648
- }
2631
+ GenericParamDefKind :: Const { .. } => self
2632
+ . mk_const (
2633
+ ParamConst { index : param. index , name : param. name } ,
2634
+ self . type_of ( param. def_id ) ,
2635
+ )
2636
+ . into ( ) ,
2649
2637
}
2650
2638
}
2651
2639
0 commit comments