mirror of
https://github.com/clap-rs/clap
synced 2024-11-15 09:07:10 +00:00
Merge pull request #4118 from miguelff/master
Fix abort message when deriving non-unit enum variants
This commit is contained in:
commit
b1e3dad190
2 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue