about summary refs log tree commit diff
path: root/tests/ui/binding/match-range-infer.rs
blob: aebfa0376516dda78e0939b2e2cdfd127e1fcbee (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")
    }
}