X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftest%2Frun-pass%2Fconst-int-wrapping.rs;h=db86c25194f08585d3e6824242a0dd807531461e;hb=adea1317c24738563a507b817bbf9c57471279f0;hp=140fd57ecb8026b537b5ad095b34d7a7c402e744;hpb=03acebe2ca6bfeeb537449c786c397fbc45dc576;p=rust.git diff --git a/src/test/run-pass/const-int-wrapping.rs b/src/test/run-pass/const-int-wrapping.rs index 140fd57ecb8..db86c25194f 100644 --- a/src/test/run-pass/const-int-wrapping.rs +++ b/src/test/run-pass/const-int-wrapping.rs @@ -16,26 +16,22 @@ const NEG_A: u32 = 5u32.wrapping_neg(); const NEG_B: u32 = 1234567890u32.wrapping_neg(); -fn ident(ident: T) -> T { - ident -} - fn main() { - assert_eq!(ADD_A, ident(255)); - assert_eq!(ADD_B, ident(199)); + assert_eq!(ADD_A, 255); + assert_eq!(ADD_B, 199); - assert_eq!(SUB_A, ident(0)); - assert_eq!(SUB_B, ident(101)); + assert_eq!(SUB_A, 0); + assert_eq!(SUB_B, 101); - assert_eq!(MUL_A, ident(120)); - assert_eq!(MUL_B, ident(44)); + assert_eq!(MUL_A, 120); + assert_eq!(MUL_B, 44); - assert_eq!(SHL_A, ident(128)); - assert_eq!(SHL_B, ident(1)); + assert_eq!(SHL_A, 128); + assert_eq!(SHL_B, 1); - assert_eq!(SHR_A, ident(1)); - assert_eq!(SHR_B, ident(128)); + assert_eq!(SHR_A, 1); + assert_eq!(SHR_B, 128); - assert_eq!(NEG_A, ident(4294967291)); - assert_eq!(NEG_B, ident(3060399406)); + assert_eq!(NEG_A, 4294967291); + assert_eq!(NEG_B, 3060399406); }