summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/match-range-infer.rs
blob: 19d1cb89d4a354b45ac138c137b363c3742b09f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass
// Test that type inference for range patterns works correctly (is bi-directional).

pub fn main() {
    match 1 {
        1 ..= 3 => {}
        _ => panic!("should match range")
    }
    match 1 {
        1 ..= 3u16 => {}
        _ => panic!("should match range with inferred start type")
    }
    match 1 {
        1u16 ..= 3 => {}
        _ => panic!("should match range with inferred end type")
    }
}