@@ -999,7 +999,7 @@ impl<'tcx> InferCtxt<'tcx> {
999999 }
10001000
10011001 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)
10031003 }
10041004
10051005 pub fn next_const_var_in_universe (
@@ -1013,7 +1013,7 @@ impl<'tcx> InferCtxt<'tcx> {
10131013 . borrow_mut ( )
10141014 . const_unification_table ( )
10151015 . new_key ( ConstVarValue { origin, val : ConstVariableValue :: Unknown { universe } } ) ;
1016- self . tcx . mk_const ( vid, ty)
1016+ ty :: Const :: new_var ( self . tcx , vid, ty)
10171017 }
10181018
10191019 pub fn next_const_var_id ( & self , origin : ConstVariableOrigin ) -> ConstVid < ' tcx > {
@@ -1131,15 +1131,15 @@ impl<'tcx> InferCtxt<'tcx> {
11311131 origin,
11321132 val : ConstVariableValue :: Unknown { universe : self . universe ( ) } ,
11331133 } ) ;
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 ( )
11431143 }
11441144 }
11451145 }
@@ -1472,7 +1472,7 @@ impl<'tcx> InferCtxt<'tcx> {
14721472 span : Option < Span > ,
14731473 ) -> Result < ty:: Const < ' tcx > , ErrorHandled > {
14741474 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) ) ,
14761476 Ok ( None ) => {
14771477 let tcx = self . tcx ;
14781478 let def_id = unevaluated. def ;
@@ -1964,7 +1964,8 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>(
19641964 if ty. has_non_region_param ( ) || ty. has_non_region_infer ( ) {
19651965 bug ! ( "const `{c}`'s type should not reference params or types" ) ;
19661966 }
1967- self . tcx . mk_const (
1967+ ty:: Const :: new_placeholder (
1968+ self . tcx ,
19681969 ty:: PlaceholderConst {
19691970 universe : ty:: UniverseIndex :: ROOT ,
19701971 bound : ty:: BoundVar :: from_u32 ( {
0 commit comments