]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/pat-ranges.rs
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
[rust.git] / src / test / ui / binding / pat-ranges.rs
1 // run-pass
2 // Parsing of range patterns
3
4 #![allow(ellipsis_inclusive_range_patterns)]
5
6 const NUM1: i32 = 10;
7
8 mod m {
9     pub const NUM2: i32 = 16;
10 }
11
12 fn main() {
13     if let NUM1 ... m::NUM2 = 10 {} else { panic!() }
14     if let ::NUM1 ... ::m::NUM2 = 11 {} else { panic!() }
15     if let -13 ... -10 = 12 { panic!() } else {}
16
17     if let NUM1 ..= m::NUM2 = 10 {} else { panic!() }
18     if let ::NUM1 ..= ::m::NUM2 = 11 {} else { panic!() }
19     if let -13 ..= -10 = 12 { panic!() } else {}
20 }