-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(derive): Abort on non-unit variant
- Loading branch information
1 parent
06f855f
commit ee3d12e
Showing
4 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use clap::ArgEnum; | ||
|
||
#[derive(ArgEnum, Clone, Debug)] | ||
enum Opt { | ||
Foo(usize), | ||
} | ||
|
||
fn main() { | ||
println!("{:?}", Opt::Foo(42)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
error: `#[derive(ArgEnum)]` only supports non-unit variants | ||
--> tests/derive_ui/arg_enum_non_unit.rs:3:10 | ||
| | ||
3 | #[derive(ArgEnum, Clone, Debug)] | ||
| ^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `ArgEnum` (in Nightly builds, run with -Z macro-backtrace for more info) |