This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch add-automatically-derived-attribute
in repository https://gitbox.apache.org/repos/asf/avro-rs.git

commit 77c8f5fe89496fd57b9240727c27a76f84d0f932
Author: Martin Tzvetanov Grigorov <[email protected]>
AuthorDate: Tue Jun 10 11:51:00 2025 +0300

    feat: Add `#[automatically_derived]` attribute to the auto generated impls
    
    See 
https://doc.rust-lang.org/reference/attributes/derive.html#the-automatically_derived-attribute
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
 avro_derive/src/lib.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/avro_derive/src/lib.rs b/avro_derive/src/lib.rs
index bf52f95..767a46a 100644
--- a/avro_derive/src/lib.rs
+++ b/avro_derive/src/lib.rs
@@ -112,6 +112,7 @@ fn derive_avro_schema(input: &mut DeriveInput) -> 
Result<TokenStream, Vec<syn::E
     let ident = &input.ident;
     let (impl_generics, ty_generics, where_clause) = 
input.generics.split_for_impl();
     Ok(quote! {
+        #[automatically_derived]
         impl #impl_generics apache_avro::schema::derive::AvroSchemaComponent 
for #ident #ty_generics #where_clause {
             fn get_schema_in_ctxt(named_schemas: &mut 
std::collections::HashMap<apache_avro::schema::Name, 
apache_avro::schema::Schema>, enclosing_namespace: &Option<String>) -> 
apache_avro::schema::Schema {
                 let name =  
apache_avro::schema::Name::new(#full_schema_name).expect(&format!("Unable to 
parse schema name {}", 
#full_schema_name)[..]).fully_qualified_name(enclosing_namespace);
@@ -521,6 +522,7 @@ mod tests {
                 let derived = derive_avro_schema(&mut input);
                 assert!(derived.is_ok());
                 assert_eq!(derived.unwrap().to_string(), quote! {
+                    #[automatically_derived]
                     impl apache_avro::schema::derive::AvroSchemaComponent for 
Basic {
                         fn get_schema_in_ctxt(
                             named_schemas: &mut std::collections::HashMap<

Reply via email to