@@ -999,7 +999,7 @@ impl<'tcx> InferCtxt<'tcx> {
999
999
}
1000
1000
1001
1001
pub fn next_const_var ( & self , ty : Ty < ' tcx > , origin : ConstVariableOrigin ) -> ty:: Const < ' tcx > {
1002
- self . tcx . mk_const ( self . next_const_var_id ( origin) , ty)
1002
+ ty :: Const :: new_var ( self . tcx , self . next_const_var_id ( origin) , ty)
1003
1003
}
1004
1004
1005
1005
pub fn next_const_var_in_universe (
@@ -1013,7 +1013,7 @@ impl<'tcx> InferCtxt<'tcx> {
1013
1013
. borrow_mut ( )
1014
1014
. const_unification_table ( )
1015
1015
. new_key ( ConstVarValue { origin, val : ConstVariableValue :: Unknown { universe } } ) ;
1016
- self . tcx . mk_const ( vid, ty)
1016
+ ty :: Const :: new_var ( self . tcx , vid, ty)
1017
1017
}
1018
1018
1019
1019
pub fn next_const_var_id ( & self , origin : ConstVariableOrigin ) -> ConstVid < ' tcx > {
@@ -1131,15 +1131,15 @@ impl<'tcx> InferCtxt<'tcx> {
1131
1131
origin,
1132
1132
val : ConstVariableValue :: Unknown { universe : self . universe ( ) } ,
1133
1133
} ) ;
1134
- self . tcx
1135
- . mk_const (
1136
- const_var_id,
1137
- self . tcx
1138
- . type_of ( param. def_id )
1139
- . no_bound_vars ( )
1140
- . expect ( "const parameter types cannot be generic" ) ,
1141
- )
1142
- . into ( )
1134
+ ty :: Const :: new_var (
1135
+ self . tcx ,
1136
+ const_var_id,
1137
+ self . tcx
1138
+ . type_of ( param. def_id )
1139
+ . no_bound_vars ( )
1140
+ . expect ( "const parameter types cannot be generic" ) ,
1141
+ )
1142
+ . into ( )
1143
1143
}
1144
1144
}
1145
1145
}
@@ -1472,7 +1472,7 @@ impl<'tcx> InferCtxt<'tcx> {
1472
1472
span : Option < Span > ,
1473
1473
) -> Result < ty:: Const < ' tcx > , ErrorHandled > {
1474
1474
match self . const_eval_resolve ( param_env, unevaluated, span) {
1475
- Ok ( Some ( val) ) => Ok ( self . tcx . mk_const ( val, ty) ) ,
1475
+ Ok ( Some ( val) ) => Ok ( ty :: Const :: new_value ( self . tcx , val, ty) ) ,
1476
1476
Ok ( None ) => {
1477
1477
let tcx = self . tcx ;
1478
1478
let def_id = unevaluated. def ;
@@ -1964,7 +1964,8 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>(
1964
1964
if ty. has_non_region_param ( ) || ty. has_non_region_infer ( ) {
1965
1965
bug ! ( "const `{c}`'s type should not reference params or types" ) ;
1966
1966
}
1967
- self . tcx . mk_const (
1967
+ ty:: Const :: new_placeholder (
1968
+ self . tcx ,
1968
1969
ty:: PlaceholderConst {
1969
1970
universe : ty:: UniverseIndex :: ROOT ,
1970
1971
bound : ty:: BoundVar :: from_u32 ( {
0 commit comments