fix the build errors
This commit is contained in:
parent
31bf7e1b51
commit
e06302fda9
2 changed files with 6 additions and 3 deletions
|
@ -13,7 +13,7 @@ const SHL_B: (u32, bool) = 0x1u32.overflowing_shl(132);
|
||||||
const SHR_A: (u32, bool) = 0x10u32.overflowing_shr(4);
|
const SHR_A: (u32, bool) = 0x10u32.overflowing_shr(4);
|
||||||
const SHR_B: (u32, bool) = 0x10u32.overflowing_shr(132);
|
const SHR_B: (u32, bool) = 0x10u32.overflowing_shr(132);
|
||||||
|
|
||||||
const NEG_A: (u32, bool) = 0.overflowing_neg();
|
const NEG_A: (u32, bool) = 0u32.overflowing_neg();
|
||||||
const NEG_B: (u32, bool) = core::u32::MAX.overflowing_neg();
|
const NEG_B: (u32, bool) = core::u32::MAX.overflowing_neg();
|
||||||
|
|
||||||
fn ident<T>(ident: T) -> T {
|
fn ident<T>(ident: T) -> T {
|
||||||
|
|
|
@ -33,6 +33,9 @@ fn main() {
|
||||||
assert_eq!(SHL_A, ident(128));
|
assert_eq!(SHL_A, ident(128));
|
||||||
assert_eq!(SHL_B, ident(1));
|
assert_eq!(SHL_B, ident(1));
|
||||||
|
|
||||||
assert_eq!(SHR_A, ident(4294967291));
|
assert_eq!(SHR_A, ident(1));
|
||||||
assert_eq!(SHR_B, ident(3060399406));
|
assert_eq!(SHR_B, ident(128));
|
||||||
|
|
||||||
|
assert_eq!(NEG_A, ident(4294967291));
|
||||||
|
assert_eq!(NEG_B, ident(3060399406));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue