2021-02-08 14:43:52 -06:00
|
|
|
#[derive(PartialEq, Eq)]
|
|
|
|
enum X { A, B, C, }
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = X::A;
|
|
|
|
let y = Some(X::A);
|
|
|
|
|
|
|
|
match (x, y) {
|
2022-09-02 22:01:35 -05:00
|
|
|
//~^ ERROR non-exhaustive patterns: `(X::A, Some(X::A))`, `(X::A, Some(X::B))`, `(X::B, Some(X::B))` and 2
|
2021-02-08 14:43:52 -06:00
|
|
|
//~| more not covered
|
|
|
|
(_, None) => false,
|
|
|
|
(v, Some(w)) if v == w => true,
|
|
|
|
(X::B, Some(X::C)) => false,
|
|
|
|
(X::B, Some(X::A)) => false,
|
|
|
|
(X::A, Some(X::C)) | (X::C, Some(X::A)) => false,
|
|
|
|
};
|
|
|
|
}
|