Closed
Description
Why is "unreachable pattern" a warning and not an error? I found some discussion in the PR: #19115 but that was in 2014.
I'm specially concerned about the following use case: Playground
pub enum Bit {
L,
H,
}
fn from(x: Bit) -> u8 {
match x {
L => 0,
H => 1,
}
}
That code throws 8 warnings at me, but I would prefer it to not compile. I also found a similar problem in stackoverflow. I think it's important to make this a clear error so beginners don't get confused.