summaryrefslogtreecommitdiffstats
path: root/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-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/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs')
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
deleted file mode 100644
index 4b7eee134..000000000
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-// check-pass
-
-// Test various exhaustive matches for `X..`, `..=X` and `..X` ranges.
-
-#![feature(exclusive_range_pattern)]
-
-fn main() {}
-
-macro_rules! m {
- ($s:expr, $($t:tt)+) => {
- match $s { $($t)+ => {} }
- }
-}
-
-macro_rules! test_int {
- ($s:expr, $min:path, $max:path) => {
- m!($s, $min..);
- m!($s, $min..5 | 5..);
- m!($s, ..5 | 5..);
- m!($s, ..=4 | 5..);
- m!($s, ..=$max);
- m!($s, ..$max | $max);
- m!(($s, true), (..5, true) | (5.., true) | ($min.., false));
- }
-}
-
-fn unsigned_int() {
- test_int!(0u8, u8::MIN, u8::MAX);
- test_int!(0u16, u16::MIN, u16::MAX);
- test_int!(0u32, u32::MIN, u32::MAX);
- test_int!(0u64, u64::MIN, u64::MAX);
- test_int!(0u128, u128::MIN, u128::MAX);
-}
-
-fn signed_int() {
- test_int!(0i8, i8::MIN, i8::MAX);
- test_int!(0i16, i16::MIN, i16::MAX);
- test_int!(0i32, i32::MIN, i32::MAX);
- test_int!(0i64, i64::MIN, i64::MAX);
- test_int!(0i128, i128::MIN, i128::MAX);
-}
-
-fn khar() {
- m!('a', ..=core::char::MAX);
- m!('a', '\u{0}'..);
- m!('a', ..='\u{D7FF}' | '\u{E000}'..);
- m!('a', ..'\u{D7FF}' | '\u{D7FF}' | '\u{E000}'..);
-}