]> git.lizzy.rs Git - rust.git/blob - src/test/ui/half-open-range-patterns/half-open-range-pats-syntactic-pass.rs
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / half-open-range-patterns / half-open-range-pats-syntactic-pass.rs
1 // check-pass
2
3 // Test the parsing of half-open ranges.
4
5 #![feature(exclusive_range_pattern)]
6 #![feature(half_open_range_patterns)]
7
8 fn main() {}
9
10 #[cfg(FALSE)]
11 fn syntax() {
12     match scrutinee {
13         X.. | 0.. | 'a'.. | 0.0f32.. => {}
14         ..=X | ..X => {}
15         ..=0 | ..0 => {}
16         ..='a' | ..'a' => {}
17         ..=0.0f32 | ..0.0f32 => {}
18     }
19 }
20
21 fn syntax2() {
22     macro_rules! mac {
23         ($e:expr) => {
24             match 0u8 { ..$e => {}, _ => {} }
25             match 0u8 { ..=$e => {}, _ => {} }
26             match 0u8 { $e.. => {}, _ => {} }
27         }
28     }
29     mac!(42u8);
30 }