summaryrefslogtreecommitdiffstats
path: root/tests/ui/inc-range-pat.rs
blob: 1eb7dd0aa3e7a08ff1b9b01c4519ed59b99db591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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 });
}