rust/tests/ui/pattern/usefulness/issue-2111.rs

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

12 lines
296 B
Rust
Raw Normal View History

fn foo(a: Option<usize>, b: Option<usize>) {
2020-12-17 00:42:49 +00:00
match (a, b) {
//~^ ERROR: non-exhaustive patterns: `(None, None)` and `(Some(_), Some(_))` not covered
2020-12-17 00:42:49 +00:00
(Some(a), Some(b)) if a == b => {}
(Some(_), None) | (None, Some(_)) => {}
}
}
fn main() {
2020-12-17 00:42:49 +00:00
foo(None, None);
}