Skip to content

Commit

Permalink
Fix message for match_wildcard_for_single_variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarcho committed Mar 17, 2021
1 parent 6cc9cac commit 575ec7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ fn check_wild_enum_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>])
cx,
MATCH_WILDCARD_FOR_SINGLE_VARIANTS,
wildcard_span,
"match on non-exhaustive enum doesn't explicitly match all known variants",
"wildcard matches only a single variant and will miss any future added variants",
"try this",
format_suggestion(x),
Applicability::MaybeIncorrect,
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/match_wildcard_for_single_variants.stderr
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:24:13
|
LL | _ => (),
| ^ help: try this: `Self::Rgb(..)`
|
= note: `-D clippy::match-wildcard-for-single-variants` implied by `-D warnings`

error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:34:9
|
LL | _ => {},
| ^ help: try this: `Foo::C`

error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:44:9
|
LL | _ => {},
| ^ help: try this: `Color::Blue`

error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:52:9
|
LL | _ => {},
| ^ help: try this: `Color::Blue`

error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:58:9
|
LL | _ => {},
| ^ help: try this: `Color::Blue`

error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:75:9
|
LL | &_ => (),
| ^^ help: try this: `Color::Blue`

error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:84:9
|
LL | _ => (),
| ^ help: try this: `C::Blue`

error: match on non-exhaustive enum doesn't explicitly match all known variants
error: wildcard matches only a single variant and will miss any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:91:9
|
LL | _ => (),
Expand Down

0 comments on commit 575ec7d

Please sign in to comment.