Skip to content

Commit

Permalink
Mark all generated trait impls as #[automatically_derived]
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 11, 2024
1 parent 46e9ecf commit 9497463
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions serde_derive/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub fn expand_derive_deserialize(input: &mut syn::DeriveInput) -> syn::Result<To
let vis = &input.vis;
let used = pretend::pretend_used(&cont, params.is_packed);
quote! {
#[automatically_derived]
impl #de_impl_generics #ident #ty_generics #where_clause {
#vis fn deserialize<__D>(__deserializer: __D) -> #serde::__private::Result<#remote #ty_generics, __D::Error>
where
Expand Down Expand Up @@ -1606,6 +1607,7 @@ fn deserialize_adjacently_tagged_enum(
lifetime: _serde::__private::PhantomData<&#delife ()>,
}

#[automatically_derived]
impl #de_impl_generics _serde::de::DeserializeSeed<#delife> for __Seed #de_ty_generics #where_clause {
type Value = #this_type #ty_generics;

Expand Down Expand Up @@ -2920,6 +2922,7 @@ fn wrap_deserialize_with(
lifetime: _serde::__private::PhantomData<&#delife ()>,
}

#[automatically_derived]
impl #de_impl_generics _serde::Deserialize<#delife> for __DeserializeWith #de_ty_generics #where_clause {
fn deserialize<__D>(#deserializer_var: __D) -> _serde::__private::Result<Self, __D::Error>
where
Expand Down
4 changes: 4 additions & 0 deletions serde_derive/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub fn expand_derive_serialize(input: &mut syn::DeriveInput) -> syn::Result<Toke
let vis = &input.vis;
let used = pretend::pretend_used(&cont, params.is_packed);
quote! {
#[automatically_derived]
impl #impl_generics #ident #ty_generics #where_clause {
#vis fn serialize<__S>(__self: &#remote #ty_generics, __serializer: __S) -> #serde::__private::Result<__S::Ok, __S::Error>
where
Expand Down Expand Up @@ -733,6 +734,7 @@ fn serialize_adjacently_tagged_variant(
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
}

#[automatically_derived]
impl #wrapper_impl_generics _serde::Serialize for __AdjacentlyTagged #wrapper_ty_generics #where_clause {
fn serialize<__S>(&self, __serializer: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
where
Expand Down Expand Up @@ -997,6 +999,7 @@ fn serialize_struct_variant_with_flatten(
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
}

#[automatically_derived]
impl #wrapper_impl_generics _serde::Serialize for __EnumFlatten #wrapper_ty_generics #where_clause {
fn serialize<__S>(&self, __serializer: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
where
Expand Down Expand Up @@ -1239,6 +1242,7 @@ fn wrap_serialize_with(
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
}

#[automatically_derived]
impl #wrapper_impl_generics _serde::Serialize for __SerializeWith #wrapper_ty_generics #where_clause {
fn serialize<__S>(&#self_var, #serializer_var: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
where
Expand Down

0 comments on commit 9497463

Please sign in to comment.