Skip to content

Commit

Permalink
fix(derive): Reduce compiler error noise
Browse files Browse the repository at this point in the history
It looks like CI hasn't been running on this and we've introduced some
problems.  It looks like we had an off-by-one error in the check for
MSRV for deciding to run ui tests.
  • Loading branch information
epage committed Jul 29, 2021
1 parent 57e87c3 commit 11e0720
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 63 deletions.
6 changes: 6 additions & 0 deletions clap_derive/src/dummies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ pub fn subcommand(name: &Ident) {
fn augment_subcommands_for_update(_app: clap::App<'_>) -> clap::App<'_> {
unimplemented!()
}
fn has_subcommand(name: &str) -> bool {
unimplemented!()
}
}
});
}
Expand All @@ -77,6 +80,9 @@ pub fn arg_enum(name: &Ident) {
fn from_str(_input: &str, _case_insensitive: bool) -> Result<Self, String> {
unimplemented!()
}
fn as_arg(&self) -> Option<&'static str> {
unimplemented!()
}
}
})
}
9 changes: 0 additions & 9 deletions clap_derive/tests/ui/arg_enum_on_struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,3 @@ error: `#[derive(ArgEnum)]` only supports enums
| ^^^^^^^
|
= note: this error originates in the derive macro `ArgEnum` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0046]: not all trait items implemented, missing: `as_arg`
--> $DIR/arg_enum_on_struct.rs:3:10
|
3 | #[derive(ArgEnum, Debug)]
| ^^^^^^^ missing `as_arg` in implementation
|
= note: this error originates in the derive macro `ArgEnum` (in Nightly builds, run with -Z macro-backtrace for more info)
= help: implement the missing item: `fn as_arg(&self) -> Option<&'static str> { todo!() }`
9 changes: 0 additions & 9 deletions clap_derive/tests/ui/enum_flatten.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,3 @@ error: `flatten` is usable only with single-typed tuple variants
14 | / #[clap(flatten)]
15 | | Variant1,
| |____________^

error[E0046]: not all trait items implemented, missing: `has_subcommand`
--> $DIR/enum_flatten.rs:11:10
|
11 | #[derive(Clap, Debug)]
| ^^^^ missing `has_subcommand` in implementation
|
= note: this error originates in the derive macro `Clap` (in Nightly builds, run with -Z macro-backtrace for more info)
= help: implement the missing item: `fn has_subcommand(_: &str) -> bool { todo!() }`
27 changes: 0 additions & 27 deletions clap_derive/tests/ui/external_subcommand_wrong_type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,3 @@ error: The enum variant marked with `external_attribute` must be a single-typed
18 | / #[clap(external_subcommand)]
19 | | Other { a: String },
| |_______________________^

error[E0046]: not all trait items implemented, missing: `has_subcommand`
--> $DIR/external_subcommand_wrong_type.rs:4:10
|
4 | #[derive(Clap, Debug)]
| ^^^^ missing `has_subcommand` in implementation
|
= note: this error originates in the derive macro `Clap` (in Nightly builds, run with -Z macro-backtrace for more info)
= help: implement the missing item: `fn has_subcommand(_: &str) -> bool { todo!() }`

error[E0046]: not all trait items implemented, missing: `has_subcommand`
--> $DIR/external_subcommand_wrong_type.rs:10:10
|
10 | #[derive(Clap, Debug)]
| ^^^^ missing `has_subcommand` in implementation
|
= note: this error originates in the derive macro `Clap` (in Nightly builds, run with -Z macro-backtrace for more info)
= help: implement the missing item: `fn has_subcommand(_: &str) -> bool { todo!() }`

error[E0046]: not all trait items implemented, missing: `has_subcommand`
--> $DIR/external_subcommand_wrong_type.rs:16:10
|
16 | #[derive(Clap, Debug)]
| ^^^^ missing `has_subcommand` in implementation
|
= note: this error originates in the derive macro `Clap` (in Nightly builds, run with -Z macro-backtrace for more info)
= help: implement the missing item: `fn has_subcommand(_: &str) -> bool { todo!() }`
9 changes: 0 additions & 9 deletions clap_derive/tests/ui/multiple_external_subcommand.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,3 @@ error: Only one variant can be marked with `external_subcommand`, this is the se
|
14 | #[clap(external_subcommand)]
| ^^^^^^^^^^^^^^^^^^^

error[E0046]: not all trait items implemented, missing: `has_subcommand`
--> $DIR/multiple_external_subcommand.rs:9:10
|
9 | #[derive(Clap, Debug)]
| ^^^^ missing `has_subcommand` in implementation
|
= note: this error originates in the derive macro `Clap` (in Nightly builds, run with -Z macro-backtrace for more info)
= help: implement the missing item: `fn has_subcommand(_: &str) -> bool { todo!() }`
9 changes: 0 additions & 9 deletions clap_derive/tests/ui/subcommand_on_struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,3 @@ error: `#[derive(Subcommand)]` only supports enums
| ^^^^^^^^^^
|
= note: this error originates in the derive macro `Subcommand` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0046]: not all trait items implemented, missing: `has_subcommand`
--> $DIR/subcommand_on_struct.rs:3:10
|
3 | #[derive(Subcommand, Debug)]
| ^^^^^^^^^^ missing `has_subcommand` in implementation
|
= note: this error originates in the derive macro `Subcommand` (in Nightly builds, run with -Z macro-backtrace for more info)
= help: implement the missing item: `fn has_subcommand(_: &str) -> bool { todo!() }`

0 comments on commit 11e0720

Please sign in to comment.