diff --git a/clap_derive/src/derives/args.rs b/clap_derive/src/derives/args.rs index 83598f56477..5d587950e56 100644 --- a/clap_derive/src/derives/args.rs +++ b/clap_derive/src/derives/args.rs @@ -99,6 +99,7 @@ pub fn gen_for_struct( clippy::suspicious_else_formatting, clippy::almost_swapped, )] + #[automatically_derived] impl #impl_generics clap::FromArgMatches for #item_name #ty_generics #where_clause { fn from_arg_matches(__clap_arg_matches: &clap::ArgMatches) -> ::std::result::Result { Self::from_arg_matches_mut(&mut __clap_arg_matches.clone()) @@ -134,6 +135,7 @@ pub fn gen_for_struct( clippy::suspicious_else_formatting, clippy::almost_swapped, )] + #[automatically_derived] impl #impl_generics clap::Args for #item_name #ty_generics #where_clause { fn group_id() -> Option { #group_id diff --git a/clap_derive/src/derives/into_app.rs b/clap_derive/src/derives/into_app.rs index 72f081fd8d1..71eb59f5127 100644 --- a/clap_derive/src/derives/into_app.rs +++ b/clap_derive/src/derives/into_app.rs @@ -42,6 +42,7 @@ pub fn gen_for_struct( clippy::suspicious_else_formatting, clippy::almost_swapped, )] + #[automatically_derived] impl #impl_generics clap::CommandFactory for #item_name #ty_generics #where_clause { fn command<'b>() -> clap::Command { let #app_var = clap::Command::new(#name); @@ -82,6 +83,7 @@ pub fn gen_for_enum( clippy::suspicious_else_formatting, clippy::almost_swapped, )] + #[automatically_derived] impl #impl_generics clap::CommandFactory for #item_name #ty_generics #where_clause { fn command<'b>() -> clap::Command { let #app_var = clap::Command::new(#name) diff --git a/clap_derive/src/derives/parser.rs b/clap_derive/src/derives/parser.rs index 926c50ce885..605ae1902ee 100644 --- a/clap_derive/src/derives/parser.rs +++ b/clap_derive/src/derives/parser.rs @@ -86,6 +86,7 @@ fn gen_for_struct( let args = args::gen_for_struct(item, item_name, generics, fields)?; Ok(quote! { + #[automatically_derived] impl #impl_generics clap::Parser for #item_name #ty_generics #where_clause {} #into_app @@ -105,6 +106,7 @@ fn gen_for_enum( let subcommand = subcommand::gen_for_enum(item, item_name, generics, variants)?; Ok(quote! { + #[automatically_derived] impl #impl_generics clap::Parser for #item_name #ty_generics #where_clause {} #into_app diff --git a/clap_derive/src/derives/subcommand.rs b/clap_derive/src/derives/subcommand.rs index 5c2350969ab..51450d24ac2 100644 --- a/clap_derive/src/derives/subcommand.rs +++ b/clap_derive/src/derives/subcommand.rs @@ -79,6 +79,7 @@ pub fn gen_for_enum( clippy::suspicious_else_formatting, clippy::almost_swapped, )] + #[automatically_derived] impl #impl_generics clap::FromArgMatches for #item_name #ty_generics #where_clause { fn from_arg_matches(__clap_arg_matches: &clap::ArgMatches) -> ::std::result::Result { Self::from_arg_matches_mut(&mut __clap_arg_matches.clone()) @@ -105,6 +106,7 @@ pub fn gen_for_enum( clippy::suspicious_else_formatting, clippy::almost_swapped, )] + #[automatically_derived] impl #impl_generics clap::Subcommand for #item_name #ty_generics #where_clause { fn augment_subcommands <'b>(__clap_app: clap::Command) -> clap::Command { #augmentation diff --git a/clap_derive/src/derives/value_enum.rs b/clap_derive/src/derives/value_enum.rs index 6f107c01c37..b7d8c2f836c 100644 --- a/clap_derive/src/derives/value_enum.rs +++ b/clap_derive/src/derives/value_enum.rs @@ -64,6 +64,7 @@ pub fn gen_for_enum( clippy::suspicious_else_formatting, clippy::almost_swapped, )] + #[automatically_derived] impl clap::ValueEnum for #item_name { #value_variants #to_possible_value diff --git a/clap_derive/src/dummies.rs b/clap_derive/src/dummies.rs index b10bedc64a4..3a1581b23b5 100644 --- a/clap_derive/src/dummies.rs +++ b/clap_derive/src/dummies.rs @@ -7,6 +7,7 @@ use quote::quote; pub fn parser(name: &Ident) -> proc_macro2::TokenStream { let into_app = into_app(name); quote!( + #[automatically_derived] impl clap::Parser for #name {} #into_app ) @@ -15,6 +16,7 @@ pub fn parser(name: &Ident) -> proc_macro2::TokenStream { #[must_use] pub fn into_app(name: &Ident) -> proc_macro2::TokenStream { quote! { + #[automatically_derived] impl clap::CommandFactory for #name { fn command<'b>() -> clap::Command { unimplemented!() @@ -29,6 +31,7 @@ pub fn into_app(name: &Ident) -> proc_macro2::TokenStream { #[must_use] pub fn from_arg_matches(name: &Ident) -> proc_macro2::TokenStream { quote! { + #[automatically_derived] impl clap::FromArgMatches for #name { fn from_arg_matches(_m: &clap::ArgMatches) -> ::std::result::Result { unimplemented!() @@ -44,6 +47,7 @@ pub fn from_arg_matches(name: &Ident) -> proc_macro2::TokenStream { pub fn subcommand(name: &Ident) -> proc_macro2::TokenStream { let from_arg_matches = from_arg_matches(name); quote! { + #[automatically_derived] impl clap::Subcommand for #name { fn augment_subcommands(_cmd: clap::Command) -> clap::Command { unimplemented!() @@ -63,6 +67,7 @@ pub fn subcommand(name: &Ident) -> proc_macro2::TokenStream { pub fn args(name: &Ident) -> proc_macro2::TokenStream { let from_arg_matches = from_arg_matches(name); quote! { + #[automatically_derived] impl clap::Args for #name { fn augment_args(_cmd: clap::Command) -> clap::Command { unimplemented!() @@ -78,6 +83,7 @@ pub fn args(name: &Ident) -> proc_macro2::TokenStream { #[must_use] pub fn value_enum(name: &Ident) -> proc_macro2::TokenStream { quote! { + #[automatically_derived] impl clap::ValueEnum for #name { fn value_variants<'a>() -> &'a [Self]{ unimplemented!()