File tree 1 file changed +2
-2
lines changed
src/librustc/mir/interpret
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -368,10 +368,10 @@ impl<'tcx, Tag> Scalar<Tag> {
368
368
target_size : Size ,
369
369
cx : & impl HasDataLayout ,
370
370
) -> Result < u128 , Pointer < Tag > > {
371
+ assert_ne ! ( target_size. bytes( ) , 0 , "you should never look at the bits of a ZST" ) ;
371
372
match self {
372
373
Scalar :: Raw { data, size } => {
373
374
assert_eq ! ( target_size. bytes( ) , size as u64 ) ;
374
- assert_ne ! ( size, 0 , "you should never look at the bits of a ZST" ) ;
375
375
Scalar :: check_data ( data, size) ;
376
376
Ok ( data)
377
377
}
@@ -386,10 +386,10 @@ impl<'tcx, Tag> Scalar<Tag> {
386
386
/// It is just a helper for other methods in this file.
387
387
#[ inline]
388
388
fn to_bits ( self , target_size : Size ) -> InterpResult < ' tcx , u128 > {
389
+ assert_ne ! ( target_size. bytes( ) , 0 , "you should never look at the bits of a ZST" ) ;
389
390
match self {
390
391
Scalar :: Raw { data, size } => {
391
392
assert_eq ! ( target_size. bytes( ) , size as u64 ) ;
392
- assert_ne ! ( size, 0 , "you should never look at the bits of a ZST" ) ;
393
393
Scalar :: check_data ( data, size) ;
394
394
Ok ( data)
395
395
}
You can’t perform that action at this time.
0 commit comments