2019-12-11 03:04:34 -06:00
|
|
|
// check-pass
|
|
|
|
|
|
|
|
// Test the parsing of half-open ranges.
|
|
|
|
|
|
|
|
#![feature(exclusive_range_pattern)]
|
|
|
|
|
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
#[cfg(FALSE)]
|
|
|
|
fn syntax() {
|
|
|
|
match scrutinee {
|
|
|
|
X.. | 0.. | 'a'.. | 0.0f32.. => {}
|
2020-01-10 23:49:43 -06:00
|
|
|
..=X | ..X => {}
|
|
|
|
..=0 | ..0 => {}
|
|
|
|
..='a' | ..'a' => {}
|
|
|
|
..=0.0f32 | ..0.0f32 => {}
|
2019-12-11 03:04:34 -06:00
|
|
|
}
|
2020-01-10 23:49:43 -06:00
|
|
|
}
|
2019-12-11 03:04:34 -06:00
|
|
|
|
2020-01-10 23:49:43 -06:00
|
|
|
fn syntax2() {
|
2019-12-11 03:04:34 -06:00
|
|
|
macro_rules! mac {
|
|
|
|
($e:expr) => {
|
2020-01-10 23:49:43 -06:00
|
|
|
match 0u8 { ..$e => {}, _ => {} }
|
|
|
|
match 0u8 { ..=$e => {}, _ => {} }
|
|
|
|
match 0u8 { $e.. => {}, _ => {} }
|
2019-12-11 03:04:34 -06:00
|
|
|
}
|
|
|
|
}
|
2020-01-10 23:49:43 -06:00
|
|
|
mac!(42u8);
|
2019-12-11 03:04:34 -06:00
|
|
|
}
|