X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftest%2Frun-pass%2Fconst-int-overflowing.rs;h=e8fd022e6829633ecf1c6a970d282778c89f9a74;hb=5256efb80002bfcdbef2c6f007e43935c7d11432;hp=ae7ee5aa96e3e945c9a8d702906e4d3798f48a86;hpb=43d26b1f35401c9341154192db000db456ee5ca2;p=rust.git diff --git a/src/test/run-pass/const-int-overflowing.rs b/src/test/run-pass/const-int-overflowing.rs index ae7ee5aa96e..e8fd022e682 100644 --- a/src/test/run-pass/const-int-overflowing.rs +++ b/src/test/run-pass/const-int-overflowing.rs @@ -1,5 +1,3 @@ -#![feature(const_int_overflowing)] - const ADD_A: (u32, bool) = 5u32.overflowing_add(2); const ADD_B: (u32, bool) = u32::max_value().overflowing_add(1); @@ -15,6 +13,9 @@ const SHR_A: (u32, bool) = 0x10u32.overflowing_shr(4); const SHR_B: (u32, bool) = 0x10u32.overflowing_shr(132); +const NEG_A: (u32, bool) = 0.overflowing_neg(); +const NEG_B: (u32, bool) = core::u32::MAX.overflowing_neg(); + fn ident(ident: T) -> T { ident } @@ -34,4 +35,7 @@ fn main() { assert_eq!(SHR_A, ident((0x1, false))); assert_eq!(SHR_B, ident((0x1, true))); + + assert_eq!(NEG_A, ident((0, false))); + assert_eq!(NEG_B, ident((1, true))); }