Closed
Description
Say I have the following enum in crate b
:
#![feature(non_exhaustive)]
pub enum Enum {
Unit,
#[non_exhaustive] Struct { x: bool }
}
And I match on it in crate a
:
#![deny(unreachable_patterns)]
match Enum::Unit {
Enum::Struct { .. } => {}
Enum::Struct { .. } => {} // This should error but doesn't
_ => {}
}
The second branch is not detected to be unreachable. This is on current nightly; playground link (hacky).