2017-09-19 05:40:04 +00:00
|
|
|
// Test old and new syntax for inclusive range patterns.
|
|
|
|
|
2019-05-30 06:20:30 -04:00
|
|
|
#![allow(ellipsis_inclusive_range_patterns)]
|
|
|
|
|
2017-09-19 05:40:04 +00:00
|
|
|
fn main() {
|
|
|
|
assert!(match 42 { 0 ... 100 => true, _ => false });
|
|
|
|
assert!(match 42 { 0 ..= 100 => true, _ => false });
|
|
|
|
|
|
|
|
assert!(match 'x' { 'a' ... 'z' => true, _ => false });
|
|
|
|
assert!(match 'x' { 'a' ..= 'z' => true, _ => false });
|
|
|
|
}
|