2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2015-04-03 02:56:27 +00:00
|
|
|
// Parsing of range patterns
|
|
|
|
|
2019-05-30 10:20:30 +00:00
|
|
|
#![allow(ellipsis_inclusive_range_patterns)]
|
|
|
|
|
2015-04-03 02:56:27 +00:00
|
|
|
const NUM1: i32 = 10;
|
|
|
|
|
|
|
|
mod m {
|
|
|
|
pub const NUM2: i32 = 16;
|
|
|
|
}
|
|
|
|
|
2015-02-19 14:01:57 +00:00
|
|
|
fn main() {
|
2015-04-03 02:56:27 +00:00
|
|
|
if let NUM1 ... m::NUM2 = 10 {} else { panic!() }
|
|
|
|
if let ::NUM1 ... ::m::NUM2 = 11 {} else { panic!() }
|
|
|
|
if let -13 ... -10 = 12 { panic!() } else {}
|
2019-05-30 10:20:30 +00:00
|
|
|
|
|
|
|
if let NUM1 ..= m::NUM2 = 10 {} else { panic!() }
|
|
|
|
if let ::NUM1 ..= ::m::NUM2 = 11 {} else { panic!() }
|
|
|
|
if let -13 ..= -10 = 12 { panic!() } else {}
|
2015-02-19 14:01:57 +00:00
|
|
|
}
|