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.

22 lines
466 B
Rust
Raw Normal View History

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