-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2850: fix: Add test for flattening struct in enum r=epage a=pksunkara Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
- Loading branch information
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ive/tests/ui/flatten_on_subcommand.stderr → ...ve/tests/ui/flatten_enum_in_struct.stderr
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 @@ | ||
#[derive(clap::Parser)] | ||
enum Opt { | ||
#[clap(flatten)] | ||
Sub(SubCmd), | ||
} | ||
|
||
#[derive(clap::Parser)] | ||
struct SubCmd {} | ||
|
||
fn main() {} |
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,26 @@ | ||
error[E0277]: the trait bound `SubCmd: Subcommand` is not satisfied | ||
--> $DIR/flatten_struct_in_enum.rs:1:10 | ||
| | ||
1 | #[derive(clap::Parser)] | ||
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd` | ||
| | ||
= note: required by `has_subcommand` | ||
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `SubCmd: Subcommand` is not satisfied | ||
--> $DIR/flatten_struct_in_enum.rs:1:10 | ||
| | ||
1 | #[derive(clap::Parser)] | ||
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd` | ||
| | ||
= note: required by `augment_subcommands` | ||
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `SubCmd: Subcommand` is not satisfied | ||
--> $DIR/flatten_struct_in_enum.rs:1:10 | ||
| | ||
1 | #[derive(clap::Parser)] | ||
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd` | ||
| | ||
= note: required by `augment_subcommands_for_update` | ||
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info) |