summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0058_range_pat.rs
blob: 2411d51096b3b0a1c65f884b8d103d9ba1f5fc54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
fn main() {
    match 92 {
        0 ... 100 => (),
        101 ..= 200 => (),
        200 .. 301 => (),
        302 .. => (),
    }

    match Some(10 as u8) {
        Some(0) | None => (),
        Some(1..) => ()
    }

    match () {
        S { a: 0 } => (),
        S { a: 1.. } => (),
    }

    match () {
        [0] => (),
        [1..] => (),
    }

    match (10 as u8, 5 as u8) {
        (0, _) => (),
        (1.., _) => ()
    }
}