@@ -17,8 +17,8 @@ use crate::traits;
1717use crate :: ty:: query:: { self , TyCtxtAt } ;
1818use crate :: ty:: {
1919 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 ,
2222 PolyExistentialPredicate , PolyFnSig , Predicate , PredicateKind , PredicateS , ProjectionTy ,
2323 Region , RegionKind , ReprOptions , TraitObjectVisitor , Ty , TyKind , TyS , TyVar , TyVid , TypeAndMut ,
2424 UintTy , Visibility ,
@@ -2602,11 +2602,6 @@ impl<'tcx> TyCtxt<'tcx> {
26022602 self . mk_const_internal ( ty:: ConstS { kind : kind. into ( ) , ty } )
26032603 }
26042604
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-
26102605 #[ inline]
26112606 pub fn mk_int_var ( self , v : IntVid ) -> Ty < ' tcx > {
26122607 self . mk_ty_infer ( IntVar ( v) )
@@ -2622,30 +2617,23 @@ impl<'tcx> TyCtxt<'tcx> {
26222617 self . mk_ty ( Infer ( it) )
26232618 }
26242619
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-
26302620 #[ inline]
26312621 pub fn mk_ty_param ( self , index : u32 , name : Symbol ) -> Ty < ' tcx > {
26322622 self . mk_ty ( Param ( ParamTy { index, name } ) )
26332623 }
26342624
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-
26402625 pub fn mk_param_from_def ( self , param : & ty:: GenericParamDef ) -> GenericArg < ' tcx > {
26412626 match param. kind {
26422627 GenericParamDefKind :: Lifetime => {
26432628 self . mk_region ( ty:: ReEarlyBound ( param. to_early_bound_region_data ( ) ) ) . into ( )
26442629 }
26452630 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 ( ) ,
26492637 }
26502638 }
26512639
0 commit comments