Skip to content

Commit

Permalink
Do not #[inline] in derives, see rust-lang/rust#91231
Browse files Browse the repository at this point in the history
  • Loading branch information
mamins1376 committed Nov 25, 2021
1 parent 0a9394b commit b907379
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions rkyv_derive/src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)*
}
Expand Down Expand Up @@ -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)*
}
Expand Down Expand Up @@ -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) {}
}

Expand Down Expand Up @@ -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,)*
Expand Down
8 changes: 4 additions & 4 deletions rkyv_derive/src/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,)*
Expand Down Expand Up @@ -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,)*
Expand All @@ -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)
}
Expand Down Expand Up @@ -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,)*
Expand Down
8 changes: 4 additions & 4 deletions rkyv_derive/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::Resolver, __S::Error> {
Ok(#resolver {
#(#resolver_values,)*
Expand Down Expand Up @@ -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<Self::Resolver, __S::Error> {
Ok(#resolver(
#(#resolver_values,)*
Expand All @@ -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<Self::Resolver, __S::Error> {
Ok(#resolver)
}
Expand Down Expand Up @@ -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<Self::Resolver, __S::Error> {
Ok(match self {
#(#serialize_arms,)*
Expand Down

0 comments on commit b907379

Please sign in to comment.