Skip to content

Commit

Permalink
Merge pull request #4124 from miguelff/v3-master
Browse files Browse the repository at this point in the history
[Backport] Fix: Amend error message when deriving enums
  • Loading branch information
epage committed Aug 26, 2022
2 parents 88b941f + dae2bb7 commit d3f0931
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clap_derive/src/derives/value_enum.rs
Expand Up @@ -84,7 +84,7 @@ fn lits(
None
} else {
if !matches!(variant.fields, Fields::Unit) {
abort!(variant.span(), "`#[derive(ValueEnum)]` only supports non-unit variants, unless they are skipped");
abort!(variant.span(), "`#[derive(ValueEnum)]` only supports unit variants. Non-unit variants must be skipped");
}
let fields = attrs.field_methods(false);
let name = attrs.cased_name();
Expand Down
2 changes: 1 addition & 1 deletion tests/derive_ui/value_enum_non_unit.stderr
@@ -1,4 +1,4 @@
error: `#[derive(ValueEnum)]` only supports non-unit variants, unless they are skipped
error: `#[derive(ValueEnum)]` only supports unit variants. Non-unit variants must be skipped
--> tests/derive_ui/value_enum_non_unit.rs:5:5
|
5 | Foo(usize),
Expand Down

0 comments on commit d3f0931

Please sign in to comment.