rust/tests/ui/or-patterns/issue-70413-no-unreachable-pat-and-guard.rs

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

21 lines
377 B
Rust
Raw Normal View History

2024-03-02 19:22:37 -06:00
//@ run-pass
#![deny(unreachable_patterns)]
fn main() {
2024-03-02 19:22:37 -06:00
match (3, 42) {
(a, _) | (_, a) if a > 10 => {}
_ => unreachable!(),
}
2024-03-02 19:22:37 -06:00
match Some((3, 42)) {
Some((a, _)) | Some((_, a)) if a > 10 => {}
_ => unreachable!(),
}
2024-03-02 19:22:37 -06:00
match Some((3, 42)) {
Some((a, _) | (_, a)) if a > 10 => {}
_ => unreachable!(),
}
}