File tree 1 file changed +4
-6
lines changed
compiler/rustc_middle/src/ty
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -148,19 +148,17 @@ impl<'tcx> Const<'tcx> {
148
148
}
149
149
}
150
150
151
- pub fn from_scalar_int ( tcx : TyCtxt < ' tcx > , i : ScalarInt , ty : Ty < ' tcx > ) -> Self {
152
- let valtree = ty:: ValTree :: from_scalar_int ( i) ;
153
- tcx. mk_const ( valtree, ty)
154
- }
155
-
156
151
#[ inline]
157
152
/// Creates a constant with the given integer value and interns it.
158
153
pub fn from_bits ( tcx : TyCtxt < ' tcx > , bits : u128 , ty : ParamEnvAnd < ' tcx , Ty < ' tcx > > ) -> Self {
159
154
let size = tcx
160
155
. layout_of ( ty)
161
156
. unwrap_or_else ( |e| panic ! ( "could not compute layout for {:?}: {:?}" , ty, e) )
162
157
. size ;
163
- Self :: from_scalar_int ( tcx, ScalarInt :: try_from_uint ( bits, size) . unwrap ( ) , ty. value )
158
+ tcx. mk_const (
159
+ ty:: ValTree :: from_scalar_int ( ScalarInt :: try_from_uint ( bits, size) . unwrap ( ) ) ,
160
+ ty. value ,
161
+ )
164
162
}
165
163
166
164
#[ inline]
You can’t perform that action at this time.
0 commit comments