Commit graph

6 commits

Author SHA1 Message Date
flip1995
fae7a09eea
match_wildcard_for_single_variants: don't produce bad suggestion
This fixes a bug where match_wildcard_for_single_variants produced a
bad suggestion where besides the missing variant, one or more hidden
variants were left.

This also adds tests to the ui-tests match_wildcard_for_single_variants
and wildcard_enum_match_arm to make sure that the correct suggestion is
produced.
2021-07-01 12:38:30 +02:00
Michael Wright
8abab5561c Fix hidden variant suggestion on single variant
Fixes #6984
2021-03-31 07:36:09 +02:00
Jason Newcomb
6cc9cac4bc
Add test for #[non_exhaustive] enum in match_wildcard_for_single-variant 2021-03-17 12:04:19 -04:00
Jason Newcomb
0b7ab90eca
Improvements to match_wildcard_for_single_variants and wildcard_enum_match_arm lints
Don't lint on `Result` and `Option` types.
Considers `or` patterns.
Considers variants prefixed with `Self`
Suggestions will try to find a common prefix rather than just using the full path
2021-03-17 12:04:11 -04:00
Vardan Margaryan
d90625385e Add more test cases for match_wildcard_for_single_variants 2020-05-16 00:19:30 +03:00
Vardan Margaryan
94e4b5ec31 Add the redundant_wildcard_enum_match lint 2020-05-14 22:36:46 +03:00