]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/match-range-infer.rs
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
[rust.git] / src / test / ui / binding / match-range-infer.rs
1 // run-pass
2 // Test that type inference for range patterns works correctly (is bi-directional).
3
4 pub fn main() {
5     match 1 {
6         1 ..= 3 => {}
7         _ => panic!("should match range")
8     }
9     match 1 {
10         1 ..= 3u16 => {}
11         _ => panic!("should match range with inferred start type")
12     }
13     match 1 {
14         1u16 ..= 3 => {}
15         _ => panic!("should match range with inferred end type")
16     }
17 }