False positive in non_exhaustive_omitted_patterns: matches!
#135137
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-bug
Category: This is a bug.
F-non_exhaustive_omitted_patterns_lint
`#![feature(non_exhaustive_omitted_patterns_lint)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I believe the lint should not trigger on this code. For comparison, it correctly does not trigger on this alternative implementation of the same function:
Conceptually, for the purpose of exhaustiveness,
matches!
more closely resemblesif let
thanmatch
, even if the standard library implementation currently involvesmatch
internally in order to support guard expressions.The
non_exhaustive_omitted_patterns
should only trigger on this variation of this function.#![feature(non_exhaustive_omitted_patterns_lint)]
#89554The text was updated successfully, but these errors were encountered: