We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5256efb commit 31bf7e1Copy full SHA for 31bf7e1
src/test/run-pass/const-int-wrapping.rs
@@ -13,6 +13,9 @@ const SHL_B: u32 = 1u32.wrapping_shl(128);
13
const SHR_A: u32 = 128u32.wrapping_shr(7);
14
const SHR_B: u32 = 128u32.wrapping_shr(128);
15
16
+const NEG_A: u32 = 5u32.wrapping_neg();
17
+const NEG_B: u32 = 1234567890u32.wrapping_neg();
18
+
19
fn ident<T>(ident: T) -> T {
20
ident
21
}
@@ -30,6 +33,6 @@ fn main() {
30
33
assert_eq!(SHL_A, ident(128));
31
34
assert_eq!(SHL_B, ident(1));
32
35
- assert_eq!(SHR_A, ident(1));
- assert_eq!(SHR_B, ident(128));
36
+ assert_eq!(SHR_A, ident(4294967291));
37
+ assert_eq!(SHR_B, ident(3060399406));
38
0 commit comments