@@ -103,7 +103,7 @@ impl<'tcx> ConstValue<'tcx> {
103103#[ derive( HashStable ) ]
104104pub enum Scalar < Tag = ( ) > {
105105 /// The raw bytes of a simple value.
106- Raw ( ScalarInt ) ,
106+ Int ( ScalarInt ) ,
107107
108108 /// A pointer into an `Allocation`. An `Allocation` in the `memory` module has a list of
109109 /// relocations, but a `Scalar` is only large enough to contain one, so we just represent the
@@ -120,7 +120,7 @@ impl<Tag: fmt::Debug> fmt::Debug for Scalar<Tag> {
120120 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
121121 match self {
122122 Scalar :: Ptr ( ptr) => write ! ( f, "{:?}" , ptr) ,
123- Scalar :: Raw ( int) => write ! ( f, "{:?}" , int) ,
123+ Scalar :: Int ( int) => write ! ( f, "{:?}" , int) ,
124124 }
125125 }
126126}
@@ -129,7 +129,7 @@ impl<Tag: fmt::Debug> fmt::Display for Scalar<Tag> {
129129 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
130130 match self {
131131 Scalar :: Ptr ( ptr) => write ! ( f, "pointer to {}" , ptr) ,
132- Scalar :: Raw { .. } => fmt:: Debug :: fmt ( self , f) ,
132+ Scalar :: Int { .. } => fmt:: Debug :: fmt ( self , f) ,
133133 }
134134 }
135135}
@@ -156,7 +156,7 @@ impl Scalar<()> {
156156 pub fn with_tag < Tag > ( self , new_tag : Tag ) -> Scalar < Tag > {
157157 match self {
158158 Scalar :: Ptr ( ptr) => Scalar :: Ptr ( ptr. with_tag ( new_tag) ) ,
159- Scalar :: Raw ( int) => Scalar :: Raw ( int) ,
159+ Scalar :: Int ( int) => Scalar :: Int ( int) ,
160160 }
161161 }
162162}
@@ -169,18 +169,18 @@ impl<'tcx, Tag> Scalar<Tag> {
169169 pub fn erase_tag ( self ) -> Scalar {
170170 match self {
171171 Scalar :: Ptr ( ptr) => Scalar :: Ptr ( ptr. erase_tag ( ) ) ,
172- Scalar :: Raw ( int) => Scalar :: Raw ( int) ,
172+ Scalar :: Int ( int) => Scalar :: Int ( int) ,
173173 }
174174 }
175175
176176 #[ inline]
177177 pub fn null_ptr ( cx : & impl HasDataLayout ) -> Self {
178- Scalar :: Raw ( ScalarInt :: null ( cx. data_layout ( ) . pointer_size ) )
178+ Scalar :: Int ( ScalarInt :: null ( cx. data_layout ( ) . pointer_size ) )
179179 }
180180
181181 #[ inline]
182182 pub fn zst ( ) -> Self {
183- Scalar :: Raw ( ScalarInt :: zst ( ) )
183+ Scalar :: Int ( ScalarInt :: zst ( ) )
184184 }
185185
186186 #[ inline( always) ]
@@ -191,7 +191,7 @@ impl<'tcx, Tag> Scalar<Tag> {
191191 f_ptr : impl FnOnce ( Pointer < Tag > ) -> InterpResult < ' tcx , Pointer < Tag > > ,
192192 ) -> InterpResult < ' tcx , Self > {
193193 match self {
194- Scalar :: Raw ( int) => Ok ( Scalar :: Raw ( int. ptr_sized_op ( dl, f_int) ?) ) ,
194+ Scalar :: Int ( int) => Ok ( Scalar :: Int ( int. ptr_sized_op ( dl, f_int) ?) ) ,
195195 Scalar :: Ptr ( ptr) => Ok ( Scalar :: Ptr ( f_ptr ( ptr) ?) ) ,
196196 }
197197 }
@@ -232,17 +232,17 @@ impl<'tcx, Tag> Scalar<Tag> {
232232
233233 #[ inline]
234234 pub fn from_bool ( b : bool ) -> Self {
235- Scalar :: Raw ( b. into ( ) )
235+ Scalar :: Int ( b. into ( ) )
236236 }
237237
238238 #[ inline]
239239 pub fn from_char ( c : char ) -> Self {
240- Scalar :: Raw ( c. into ( ) )
240+ Scalar :: Int ( c. into ( ) )
241241 }
242242
243243 #[ inline]
244244 pub fn try_from_uint ( i : impl Into < u128 > , size : Size ) -> Option < Self > {
245- ScalarInt :: try_from_uint ( i, size) . map ( Scalar :: Raw )
245+ ScalarInt :: try_from_uint ( i, size) . map ( Scalar :: Int )
246246 }
247247
248248 #[ inline]
@@ -254,22 +254,22 @@ impl<'tcx, Tag> Scalar<Tag> {
254254
255255 #[ inline]
256256 pub fn from_u8 ( i : u8 ) -> Self {
257- Scalar :: Raw ( i. into ( ) )
257+ Scalar :: Int ( i. into ( ) )
258258 }
259259
260260 #[ inline]
261261 pub fn from_u16 ( i : u16 ) -> Self {
262- Scalar :: Raw ( i. into ( ) )
262+ Scalar :: Int ( i. into ( ) )
263263 }
264264
265265 #[ inline]
266266 pub fn from_u32 ( i : u32 ) -> Self {
267- Scalar :: Raw ( i. into ( ) )
267+ Scalar :: Int ( i. into ( ) )
268268 }
269269
270270 #[ inline]
271271 pub fn from_u64 ( i : u64 ) -> Self {
272- Scalar :: Raw ( i. into ( ) )
272+ Scalar :: Int ( i. into ( ) )
273273 }
274274
275275 #[ inline]
@@ -279,7 +279,7 @@ impl<'tcx, Tag> Scalar<Tag> {
279279
280280 #[ inline]
281281 pub fn try_from_int ( i : impl Into < i128 > , size : Size ) -> Option < Self > {
282- ScalarInt :: try_from_int ( i, size) . map ( Scalar :: Raw )
282+ ScalarInt :: try_from_int ( i, size) . map ( Scalar :: Int )
283283 }
284284
285285 #[ inline]
@@ -316,12 +316,12 @@ impl<'tcx, Tag> Scalar<Tag> {
316316
317317 #[ inline]
318318 pub fn from_f32 ( f : Single ) -> Self {
319- Scalar :: Raw ( f. into ( ) )
319+ Scalar :: Int ( f. into ( ) )
320320 }
321321
322322 #[ inline]
323323 pub fn from_f64 ( f : Double ) -> Self {
324- Scalar :: Raw ( f. into ( ) )
324+ Scalar :: Int ( f. into ( ) )
325325 }
326326
327327 /// This is very rarely the method you want! You should dispatch on the type
@@ -336,7 +336,7 @@ impl<'tcx, Tag> Scalar<Tag> {
336336 ) -> Result < u128 , Pointer < Tag > > {
337337 assert_ne ! ( target_size. bytes( ) , 0 , "you should never look at the bits of a ZST" ) ;
338338 match self {
339- Scalar :: Raw ( int) => Ok ( int. assert_bits ( target_size) ) ,
339+ Scalar :: Int ( int) => Ok ( int. assert_bits ( target_size) ) ,
340340 Scalar :: Ptr ( ptr) => {
341341 assert_eq ! ( target_size, cx. data_layout( ) . pointer_size) ;
342342 Err ( ptr)
@@ -350,7 +350,7 @@ impl<'tcx, Tag> Scalar<Tag> {
350350 fn to_bits ( self , target_size : Size ) -> InterpResult < ' tcx , u128 > {
351351 assert_ne ! ( target_size. bytes( ) , 0 , "you should never look at the bits of a ZST" ) ;
352352 match self {
353- Scalar :: Raw ( int) => int. to_bits ( target_size) ,
353+ Scalar :: Int ( int) => int. to_bits ( target_size) ,
354354 Scalar :: Ptr ( _) => throw_unsup ! ( ReadPointerAsBytes ) ,
355355 }
356356 }
@@ -364,14 +364,14 @@ impl<'tcx, Tag> Scalar<Tag> {
364364 pub fn assert_ptr ( self ) -> Pointer < Tag > {
365365 match self {
366366 Scalar :: Ptr ( p) => p,
367- Scalar :: Raw { .. } => bug ! ( "expected a Pointer but got Raw bits" ) ,
367+ Scalar :: Int { .. } => bug ! ( "expected a Pointer but got Raw bits" ) ,
368368 }
369369 }
370370
371371 /// Do not call this method! Dispatch based on the type instead.
372372 #[ inline]
373373 pub fn is_bits ( self ) -> bool {
374- matches ! ( self , Scalar :: Raw { .. } )
374+ matches ! ( self , Scalar :: Int { .. } )
375375 }
376376
377377 /// Do not call this method! Dispatch based on the type instead.
0 commit comments