rust/tests/ui/match/match-range-fail-2.rs

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

25 lines
655 B
Rust
Raw Normal View History

#![feature(exclusive_range_pattern)]
fn main() {
match 5 {
6 ..= 1 => { }
_ => { }
};
//~^^^ ERROR lower range bound must be less than or equal to upper
2020-01-08 17:02:10 +00:00
//~| ERROR lower range bound must be less than or equal to upper
match 5 {
0 .. 0 => { }
_ => { }
};
//~^^^ ERROR lower range bound must be less than upper
2020-01-08 17:02:10 +00:00
//~| ERROR lower range bound must be less than upper
match 5u64 {
0xFFFF_FFFF_FFFF_FFFF ..= 1 => { }
_ => { }
};
//~^^^ ERROR lower range bound must be less than or equal to upper
2020-01-08 17:02:10 +00:00
//~| ERROR lower range bound must be less than or equal to upper
}