@@ -77,13 +77,13 @@ impl<'tcx> Const<'tcx> {
77
77
78
78
match Self :: try_eval_lit_or_param ( tcx, ty, expr) {
79
79
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 {
82
82
def : def. to_global ( ) ,
83
83
substs : InternalSubsts :: identity_for_item ( tcx, def. did . to_def_id ( ) ) ,
84
84
} ) ,
85
85
ty,
86
- } ) ,
86
+ ) ,
87
87
}
88
88
}
89
89
@@ -138,10 +138,7 @@ impl<'tcx> Const<'tcx> {
138
138
let generics = tcx. generics_of ( item_def_id. to_def_id ( ) ) ;
139
139
let index = generics. param_def_id_to_index [ & def_id] ;
140
140
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) )
145
142
}
146
143
_ => None ,
147
144
}
@@ -150,7 +147,7 @@ impl<'tcx> Const<'tcx> {
150
147
/// Interns the given value as a constant.
151
148
#[ inline]
152
149
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)
154
151
}
155
152
156
153
/// Panics if self.kind != ty::ConstKind::Value
0 commit comments