diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /tests/ui/discrim/discrim-overflow-2.rs | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/discrim/discrim-overflow-2.rs')
-rw-r--r-- | tests/ui/discrim/discrim-overflow-2.rs | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/tests/ui/discrim/discrim-overflow-2.rs b/tests/ui/discrim/discrim-overflow-2.rs deleted file mode 100644 index ca24317c5..000000000 --- a/tests/ui/discrim/discrim-overflow-2.rs +++ /dev/null @@ -1,80 +0,0 @@ -// Issue 23030: Detect overflowing discriminant -// -// Check that we detect the overflow even if enum is not used. - -// See also run-pass/discrim-explicit-23030.rs where the suggested -// workaround is tested. - -fn f_i8() { - #[repr(i8)] - enum A { - Ok = i8::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn f_u8() { - #[repr(u8)] - enum A { - Ok = u8::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn f_i16() { - #[repr(i16)] - enum A { - Ok = i16::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn f_u16() { - #[repr(u16)] - enum A { - Ok = u16::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn f_i32() { - #[repr(i32)] - enum A { - Ok = i32::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn f_u32() { - #[repr(u32)] - enum A { - Ok = u32::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn f_i64() { - #[repr(i64)] - enum A { - Ok = i64::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn f_u64() { - #[repr(u64)] - enum A { - Ok = u64::MAX - 1, - Ok2, - OhNo, //~ ERROR enum discriminant overflowed [E0370] - } -} - -fn main() { } |