]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/wildcard_enum_match_arm.txt
Auto merge of #98559 - jackh726:remove-reempty, r=oli-obk
[rust.git] / src / tools / clippy / src / docs / wildcard_enum_match_arm.txt
1 ### What it does
2 Checks for wildcard enum matches using `_`.
3
4 ### Why is this bad?
5 New enum variants added by library updates can be missed.
6
7 ### Known problems
8 Suggested replacements may be incorrect if guards exhaustively cover some
9 variants, and also may not use correct path to enum if it's not present in the current scope.
10
11 ### Example
12 ```
13 match x {
14     Foo::A(_) => {},
15     _ => {},
16 }
17 ```
18
19 Use instead:
20 ```
21 match x {
22     Foo::A(_) => {},
23     Foo::B(_) => {},
24 }
25 ```