move u128 test to std_example

This commit is contained in:
Arpan Kapoor 2023-03-27 20:33:05 +05:30
parent 6e1a79c6a4
commit 68b8500235
No known key found for this signature in database
GPG Key ID: 2A7CF43212493E08
3 changed files with 1 additions and 12 deletions

View File

@ -59,7 +59,6 @@ unsafe impl Copy for u8 {}
unsafe impl Copy for u16 {} unsafe impl Copy for u16 {}
unsafe impl Copy for u32 {} unsafe impl Copy for u32 {}
unsafe impl Copy for u64 {} unsafe impl Copy for u64 {}
unsafe impl Copy for u128 {}
unsafe impl Copy for usize {} unsafe impl Copy for usize {}
unsafe impl Copy for i8 {} unsafe impl Copy for i8 {}
unsafe impl Copy for i16 {} unsafe impl Copy for i16 {}
@ -80,7 +79,6 @@ unsafe impl Sync for u8 {}
unsafe impl Sync for u16 {} unsafe impl Sync for u16 {}
unsafe impl Sync for u32 {} unsafe impl Sync for u32 {}
unsafe impl Sync for u64 {} unsafe impl Sync for u64 {}
unsafe impl Sync for u128 {}
unsafe impl Sync for usize {} unsafe impl Sync for usize {}
unsafe impl Sync for i8 {} unsafe impl Sync for i8 {}
unsafe impl Sync for i16 {} unsafe impl Sync for i16 {}
@ -296,15 +294,6 @@ impl PartialEq for u64 {
} }
} }
impl PartialEq for u128 {
fn eq(&self, other: &u128) -> bool {
(*self) == (*other)
}
fn ne(&self, other: &u128) -> bool {
(*self) != (*other)
}
}
impl PartialEq for usize { impl PartialEq for usize {
fn eq(&self, other: &usize) -> bool { fn eq(&self, other: &usize) -> bool {
(*self) == (*other) (*self) == (*other)

View File

@ -171,7 +171,6 @@ fn main() {
assert_eq!(intrinsics::bitreverse(0xddccu16), 0x33bbu16); assert_eq!(intrinsics::bitreverse(0xddccu16), 0x33bbu16);
assert_eq!(intrinsics::bitreverse(0xffee_ddccu32), 0x33bb77ffu32); assert_eq!(intrinsics::bitreverse(0xffee_ddccu32), 0x33bb77ffu32);
assert_eq!(intrinsics::bitreverse(0x1234_5678_ffee_ddccu64), 0x33bb77ff1e6a2c48u64); assert_eq!(intrinsics::bitreverse(0x1234_5678_ffee_ddccu64), 0x33bb77ff1e6a2c48u64);
assert_eq!(intrinsics::bitreverse(0x1234_5678_ffee_ddcc_1234_5678_ffee_ddccu128), 0x33bb77ff1e6a2c4833bb77ff1e6a2c48u128);
assert_eq!(intrinsics::bswap(0xabu8), 0xabu8); assert_eq!(intrinsics::bswap(0xabu8), 0xabu8);
assert_eq!(intrinsics::bswap(0xddccu16), 0xccddu16); assert_eq!(intrinsics::bswap(0xddccu16), 0xccddu16);

View File

@ -58,6 +58,7 @@ fn main() {
assert_eq!(0b0000000000000000000000000010000010000000000000000000000000000000_0000000000100000000000000000000000001000000000000100000000000000u128.leading_zeros(), 26); assert_eq!(0b0000000000000000000000000010000010000000000000000000000000000000_0000000000100000000000000000000000001000000000000100000000000000u128.leading_zeros(), 26);
assert_eq!(0b0000000000000000000000000010000000000000000000000000000000000000_0000000000000000000000000000000000001000000000000000000010000000u128.trailing_zeros(), 7); assert_eq!(0b0000000000000000000000000010000000000000000000000000000000000000_0000000000000000000000000000000000001000000000000000000010000000u128.trailing_zeros(), 7);
assert_eq!(0x1234_5678_ffee_ddcc_1234_5678_ffee_ddccu128.reverse_bits(), 0x33bb77ff1e6a2c4833bb77ff1e6a2c48u128);
let _d = 0i128.checked_div(2i128); let _d = 0i128.checked_div(2i128);
let _d = 0u128.checked_div(2u128); let _d = 0u128.checked_div(2u128);