File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ pub mod reimpls {
392
392
self . wrapping_shr ( 32 ) as i32
393
393
}
394
394
fn from_parts ( low : u32 , high : i32 ) -> i64 {
395
- low as i64 | ( high as i64 ) . wrapping_shl ( 32 )
395
+ u64 :: from_parts ( low, high as u32 ) as i64
396
396
}
397
397
}
398
398
#[ cfg( not( stage0) ) ]
@@ -404,11 +404,10 @@ pub mod reimpls {
404
404
self as u64
405
405
}
406
406
fn high ( self ) -> u64 {
407
- unsafe { * ( & self as * const u128 as * const u64 ) . offset ( 1 ) }
407
+ self . wrapping_shr ( 64 ) as u64
408
408
}
409
409
fn from_parts ( low : u64 , high : u64 ) -> u128 {
410
- #[ repr( C , packed) ] struct Parts ( u64 , u64 ) ;
411
- unsafe { :: core:: mem:: transmute ( Parts ( low, high) ) }
410
+ ( high as u128 ) . wrapping_shl ( 64 ) | low as u128
412
411
}
413
412
}
414
413
#[ cfg( not( stage0) ) ]
@@ -420,7 +419,7 @@ pub mod reimpls {
420
419
self as u64
421
420
}
422
421
fn high ( self ) -> i64 {
423
- unsafe { * ( & self as * const i128 as * const i64 ) . offset ( 1 ) }
422
+ self . wrapping_shr ( 64 ) as i64
424
423
}
425
424
fn from_parts ( low : u64 , high : i64 ) -> i128 {
426
425
u128:: from_parts ( low, high as u64 ) as i128
You can’t perform that action at this time.
0 commit comments