Closed
Description
A small demo:
#[derive(PartialEq, Eq, Clone, Copy)]
enum X { A, B, C, }
fn main() {
match (X::A, Some(X::A)) {
(_, 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,
};
}
I expected to see this happen
The usual error message indicating that patterns (A, Some(B))
and (C, Some(B))
are not covered.
Instead, this happened
Patterns (A, Some(A))
and (A, Some(B))
are detected as not covered.
rustc --version --verbose
:
rustc 1.45.0-nightly (a74d1862d 2020-05-14)
binary: rustc
commit-hash: a74d1862d4d87a56244958416fd05976c58ca1a8
commit-date: 2020-05-14
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0