diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/consts/const-int-saturating-arith.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/consts/const-int-saturating-arith.rs')
-rw-r--r-- | src/test/ui/consts/const-int-saturating-arith.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/test/ui/consts/const-int-saturating-arith.rs b/src/test/ui/consts/const-int-saturating-arith.rs deleted file mode 100644 index 7edbdd4ce..000000000 --- a/src/test/ui/consts/const-int-saturating-arith.rs +++ /dev/null @@ -1,33 +0,0 @@ -// run-pass - -const INT_U32_NO: u32 = (42 as u32).saturating_add(2); -const INT_U32: u32 = u32::MAX.saturating_add(1); -const INT_U128: u128 = u128::MAX.saturating_add(1); -const INT_I128: i128 = i128::MAX.saturating_add(1); -const INT_I128_NEG: i128 = i128::MIN.saturating_add(-1); - -const INT_U32_NO_SUB: u32 = (42 as u32).saturating_sub(2); -const INT_U32_SUB: u32 = (1 as u32).saturating_sub(2); -const INT_I32_NO_SUB: i32 = (-42 as i32).saturating_sub(2); -const INT_I32_NEG_SUB: i32 = i32::MIN.saturating_sub(1); -const INT_I32_POS_SUB: i32 = i32::MAX.saturating_sub(-1); -const INT_U128_SUB: u128 = (0 as u128).saturating_sub(1); -const INT_I128_NEG_SUB: i128 = i128::MIN.saturating_sub(1); -const INT_I128_POS_SUB: i128 = i128::MAX.saturating_sub(-1); - -fn main() { - assert_eq!(INT_U32_NO, 44); - assert_eq!(INT_U32, u32::MAX); - assert_eq!(INT_U128, u128::MAX); - assert_eq!(INT_I128, i128::MAX); - assert_eq!(INT_I128_NEG, i128::MIN); - - assert_eq!(INT_U32_NO_SUB, 40); - assert_eq!(INT_U32_SUB, 0); - assert_eq!(INT_I32_NO_SUB, -44); - assert_eq!(INT_I32_NEG_SUB, i32::MIN); - assert_eq!(INT_I32_POS_SUB, i32::MAX); - assert_eq!(INT_U128_SUB, 0); - assert_eq!(INT_I128_NEG_SUB, i128::MIN); - assert_eq!(INT_I128_POS_SUB, i128::MAX); -} |