mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +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
|
// Ignoring `push_doc_comment` as there is no top-level clap builder to add documentation
|
||||||
// to
|
// to
|
||||||
|
|
||||||
|
if res.has_explicit_methods() {
|
||||||
|
abort!(
|
||||||
|
res.methods[0].name.span(),
|
||||||
|
"{} doesn't exist for `ValueEnum` enums",
|
||||||
|
res.methods[0].name
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue