rust/tests/ui/or-patterns/simplification_subtleties.rs

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

12 lines
279 B
Rust
Raw Normal View History

2024-03-02 19:22:37 -06:00
//@ run-pass
#[allow(unreachable_patterns)]
fn main() {
// Test that we don't naively sort the two `2`s together and confuse the failure paths.
match (1, true) {
(1 | 2, false | false) => unreachable!(),
(2, _) => unreachable!(),
_ => {}
}
}