From b90737997ac402b0c5a62d4e2ebd8843355c30f5 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Sameti Date: Thu, 25 Nov 2021 22:35:31 +0330 Subject: [PATCH] Do not #[inline] in derives, see rust-lang/rust#91231 --- rkyv_derive/src/archive.rs | 8 ++++---- rkyv_derive/src/deserialize.rs | 8 ++++---- rkyv_derive/src/serialize.rs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rkyv_derive/src/archive.rs b/rkyv_derive/src/archive.rs index 1934e6f0..f5ae949e 100644 --- a/rkyv_derive/src/archive.rs +++ b/rkyv_derive/src/archive.rs @@ -312,7 +312,7 @@ fn derive_archive_impl( // Some resolvers will be (), this allow is to prevent clippy from complaining #[allow(clippy::unit_arg)] - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { #(#resolve_fields)* } @@ -492,7 +492,7 @@ fn derive_archive_impl( // Some resolvers will be (), this allow is to prevent clippy from complaining #[allow(clippy::unit_arg)] - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { #(#resolve_fields)* } @@ -586,7 +586,7 @@ fn derive_archive_impl( type Archived = #archived_type; type Resolver = #resolver #ty_generics; - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 unsafe fn resolve(&self, _: usize, _: Self::Resolver, _: *mut Self::Archived) {} } @@ -1252,7 +1252,7 @@ fn derive_archive_impl( // Some resolvers will be (), this allow is to prevent clippy from complaining #[allow(clippy::unit_arg)] - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { match resolver { #(#resolve_arms,)* diff --git a/rkyv_derive/src/deserialize.rs b/rkyv_derive/src/deserialize.rs index 457030c9..21c6a138 100644 --- a/rkyv_derive/src/deserialize.rs +++ b/rkyv_derive/src/deserialize.rs @@ -83,7 +83,7 @@ fn derive_deserialize_impl( quote! { impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #deserialize_where { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn deserialize(&self, deserializer: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> { Ok(#name { #(#deserialize_fields,)* @@ -125,7 +125,7 @@ fn derive_deserialize_impl( quote! { impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #deserialize_where { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn deserialize(&self, deserializer: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> { Ok(#name( #(#deserialize_fields,)* @@ -136,7 +136,7 @@ fn derive_deserialize_impl( } Fields::Unit => quote! { impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #where_clause { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn deserialize(&self, _: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> { Ok(#name) } @@ -238,7 +238,7 @@ fn derive_deserialize_impl( quote! { impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #deserialize_where { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn deserialize(&self, deserializer: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> { Ok(match self { #(#deserialize_variants,)* diff --git a/rkyv_derive/src/serialize.rs b/rkyv_derive/src/serialize.rs index a2b03ed9..3363c48d 100644 --- a/rkyv_derive/src/serialize.rs +++ b/rkyv_derive/src/serialize.rs @@ -77,7 +77,7 @@ fn derive_serialize_impl( quote! { impl #impl_generics Serialize<__S> for #name #ty_generics #serialize_where { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn serialize(&self, serializer: &mut __S) -> ::core::result::Result { Ok(#resolver { #(#resolver_values,)* @@ -107,7 +107,7 @@ fn derive_serialize_impl( quote! { impl #impl_generics Serialize<__S> for #name #ty_generics #serialize_where { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn serialize(&self, serializer: &mut __S) -> ::core::result::Result { Ok(#resolver( #(#resolver_values,)* @@ -119,7 +119,7 @@ fn derive_serialize_impl( Fields::Unit => { quote! { impl #impl_generics Serialize<__S> for #name #ty_generics #where_clause { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn serialize(&self, serializer: &mut __S) -> ::core::result::Result { Ok(#resolver) } @@ -204,7 +204,7 @@ fn derive_serialize_impl( quote! { impl #impl_generics Serialize<__S> for #name #ty_generics #serialize_where { - #[inline] + //#[inline] See https://github.com/rust-lang/rust/issues/91231 fn serialize(&self, serializer: &mut __S) -> ::core::result::Result { Ok(match self { #(#serialize_arms,)*