Warn when a match can be made more specific #75235
Labels
A-exhaustiveness-checking
Relating to exhaustiveness / usefulness checking of patterns
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider the following code (playground):
This code gives no warnings. However, the
as_usize()
method is entirely useless, because the match can be rewritten to be more specific:The compiler should give a warning in such a case.
The text was updated successfully, but these errors were encountered: