mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
fix(derive): Disallow attributes on top-level ValuEnum
This commit is contained in:
parent
1d973bd1c1
commit
9eb72ea5b6
1 changed files with 8 additions and 0 deletions
|
@ -99,6 +99,14 @@ impl Item {
|
|||
// Ignoring `push_doc_comment` as there is no top-level clap builder to add documentation
|
||||
// to
|
||||
|
||||
if res.has_explicit_methods() {
|
||||
abort!(
|
||||
res.methods[0].name.span(),
|
||||
"{} doesn't exist for `ValueEnum` enums",
|
||||
res.methods[0].name
|
||||
);
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue