Closed
Description
Currently the compiler only issues warnings for cases like this:
enum Foo {
A,
B
}
fn main() {
let foo = Foo::B;
match foo {
A => println!("A"),
B => println!("B"),
};
}
which prints A
since it's interpreting both A
and B
arms as catch alls.
I can't think of any possible scenario where one could use multiple catch all arms for anything, so it may be beneficial to deny compiling this altogether.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Relating to patterns and pattern matchingCategory: An issue proposing an enhancement or a PR with one.Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.