@@ -77,13 +77,13 @@ impl<'tcx> Const<'tcx> {
7777
7878 match Self :: try_eval_lit_or_param ( tcx, ty, expr) {
7979 Some ( v) => v,
80- None => tcx. mk_const ( ty :: ConstS {
81- kind : ty:: ConstKind :: Unevaluated ( ty:: UnevaluatedConst {
80+ None => tcx. mk_const (
81+ ty:: ConstKind :: Unevaluated ( ty:: UnevaluatedConst {
8282 def : def. to_global ( ) ,
8383 substs : InternalSubsts :: identity_for_item ( tcx, def. did . to_def_id ( ) ) ,
8484 } ) ,
8585 ty,
86- } ) ,
86+ ) ,
8787 }
8888 }
8989
@@ -138,10 +138,7 @@ impl<'tcx> Const<'tcx> {
138138 let generics = tcx. generics_of ( item_def_id. to_def_id ( ) ) ;
139139 let index = generics. param_def_id_to_index [ & def_id] ;
140140 let name = tcx. hir ( ) . name ( hir_id) ;
141- Some ( tcx. mk_const ( ty:: ConstS {
142- kind : ty:: ConstKind :: Param ( ty:: ParamConst :: new ( index, name) ) ,
143- ty,
144- } ) )
141+ Some ( tcx. mk_const ( ty:: ConstKind :: Param ( ty:: ParamConst :: new ( index, name) ) , ty) )
145142 }
146143 _ => None ,
147144 }
@@ -150,7 +147,7 @@ impl<'tcx> Const<'tcx> {
150147 /// Interns the given value as a constant.
151148 #[ inline]
152149 pub fn from_value ( tcx : TyCtxt < ' tcx > , val : ty:: ValTree < ' tcx > , ty : Ty < ' tcx > ) -> Self {
153- tcx. mk_const ( ConstS { kind : ConstKind :: Value ( val) , ty } )
150+ tcx. mk_const ( ConstKind :: Value ( val) , ty)
154151 }
155152
156153 /// Panics if self.kind != ty::ConstKind::Value
0 commit comments