diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/wildcard_enum_match_arm.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/wildcard_enum_match_arm.txt b/src/tools/clippy/src/docs/wildcard_enum_match_arm.txt new file mode 100644 index 000000000..09807c01c --- /dev/null +++ b/src/tools/clippy/src/docs/wildcard_enum_match_arm.txt @@ -0,0 +1,25 @@ +### What it does +Checks for wildcard enum matches using `_`. + +### Why is this bad? +New enum variants added by library updates can be missed. + +### Known problems +Suggested replacements may be incorrect if guards exhaustively cover some +variants, and also may not use correct path to enum if it's not present in the current scope. + +### Example +``` +match x { + Foo::A(_) => {}, + _ => {}, +} +``` + +Use instead: +``` +match x { + Foo::A(_) => {}, + Foo::B(_) => {}, +} +```
\ No newline at end of file |