2019-12-11 09:04:34 +00: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-11 05:49:43 +00:00
|
|
|
..=X | ..X => {}
|
|
|
|
..=0 | ..0 => {}
|
|
|
|
..='a' | ..'a' => {}
|
|
|
|
..=0.0f32 | ..0.0f32 => {}
|
2019-12-11 09:04:34 +00:00
|
|
|
}
|
2020-01-11 05:49:43 +00:00
|
|
|
}
|
2019-12-11 09:04:34 +00:00
|
|
|
|
2020-01-11 05:49:43 +00:00
|
|
|
fn syntax2() {
|
2019-12-11 09:04:34 +00:00
|
|
|
macro_rules! mac {
|
|
|
|
($e:expr) => {
|
2020-01-11 05:49:43 +00:00
|
|
|
match 0u8 { ..$e => {}, _ => {} }
|
|
|
|
match 0u8 { ..=$e => {}, _ => {} }
|
|
|
|
match 0u8 { $e.. => {}, _ => {} }
|
2019-12-11 09:04:34 +00:00
|
|
|
}
|
|
|
|
}
|
2020-01-11 05:49:43 +00:00
|
|
|
mac!(42u8);
|
2019-12-11 09:04:34 +00:00
|
|
|
}
|