]> git.lizzy.rs Git - rust.git/blob - tests/ui/half-open-range-patterns/half-open-range-pats-syntactic-pass.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / 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
7 fn main() {}
8
9 #[cfg(FALSE)]
10 fn syntax() {
11     match scrutinee {
12         X.. | 0.. | 'a'.. | 0.0f32.. => {}
13         ..=X | ..X => {}
14         ..=0 | ..0 => {}
15         ..='a' | ..'a' => {}
16         ..=0.0f32 | ..0.0f32 => {}
17     }
18 }
19
20 fn syntax2() {
21     macro_rules! mac {
22         ($e:expr) => {
23             match 0u8 { ..$e => {}, _ => {} }
24             match 0u8 { ..=$e => {}, _ => {} }
25             match 0u8 { $e.. => {}, _ => {} }
26         }
27     }
28     mac!(42u8);
29 }