diff --git a/clap_derive/src/derives/value_enum.rs b/clap_derive/src/derives/value_enum.rs index b18b665c..06d514f0 100644 --- a/clap_derive/src/derives/value_enum.rs +++ b/clap_derive/src/derives/value_enum.rs @@ -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(); diff --git a/tests/derive_ui/value_enum_non_unit.stderr b/tests/derive_ui/value_enum_non_unit.stderr index 07cc473e..c4395485 100644 --- a/tests/derive_ui/value_enum_non_unit.stderr +++ b/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),