mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
13 lines
366 B
Rust
13 lines
366 B
Rust
//@ run-pass
|
|
// Test old and new syntax for inclusive range patterns.
|
|
|
|
#![allow(ellipsis_inclusive_range_patterns)]
|
|
|
|
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 });
|
|
}
|