Skip to content

Commit

Permalink
macros: generate automatically_derived attribute
Browse files Browse the repository at this point in the history
It is customary that auto-generated trait impls have that attribute.
Also, this disables dead code analysis for derived impls.
  • Loading branch information
wprzytula committed Dec 8, 2024
1 parent d7a02a4 commit 69f6e59
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions scylla-macros/src/deserialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ where
let items = items.into_iter();

parse_quote! {
#[automatically_derived]
impl<#frame_lifetime, #metadata_lifetime, #impl_generics>
#trait_<#frame_lifetime, #metadata_lifetime> for #struct_name #ty_generics
where #(#predicates),*
Expand Down
1 change: 1 addition & 0 deletions scylla-macros/src/serialize/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pub(crate) fn derive_serialize_row(tokens_input: TokenStream) -> Result<syn::Ite
let is_empty_item = gen.generate_is_empty();

let res = parse_quote! {
#[automatically_derived]
impl #impl_generics #implemented_trait for #struct_name #ty_generics #where_clause {
#serialize_item
#is_empty_item
Expand Down
1 change: 1 addition & 0 deletions scylla-macros/src/serialize/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ pub(crate) fn derive_serialize_value(
let serialize_item = gen.generate_serialize();

let res = parse_quote! {
#[automatically_derived]
impl #impl_generics #implemented_trait for #struct_name #ty_generics #where_clause {
#serialize_item
}
Expand Down

0 comments on commit 69f6e59

Please sign in to comment.