rust/tests/ui/binding/pat-ranges.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
490 B
Rust
Raw Normal View History

//@ run-pass
2015-04-03 02:56:27 +00:00
// Parsing of range patterns
#![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 {}
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
}