-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
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.
codyps, oli-obk, mark-i-m and zshipko
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.