Skip to content

Commit b907379

Browse files
committed
Do not #[inline] in derives, see rust-lang/rust#91231
1 parent 0a9394b commit b907379

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

rkyv_derive/src/archive.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ fn derive_archive_impl(
312312

313313
// Some resolvers will be (), this allow is to prevent clippy from complaining
314314
#[allow(clippy::unit_arg)]
315-
#[inline]
315+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
316316
unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) {
317317
#(#resolve_fields)*
318318
}
@@ -492,7 +492,7 @@ fn derive_archive_impl(
492492

493493
// Some resolvers will be (), this allow is to prevent clippy from complaining
494494
#[allow(clippy::unit_arg)]
495-
#[inline]
495+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
496496
unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) {
497497
#(#resolve_fields)*
498498
}
@@ -586,7 +586,7 @@ fn derive_archive_impl(
586586
type Archived = #archived_type;
587587
type Resolver = #resolver #ty_generics;
588588

589-
#[inline]
589+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
590590
unsafe fn resolve(&self, _: usize, _: Self::Resolver, _: *mut Self::Archived) {}
591591
}
592592

@@ -1252,7 +1252,7 @@ fn derive_archive_impl(
12521252

12531253
// Some resolvers will be (), this allow is to prevent clippy from complaining
12541254
#[allow(clippy::unit_arg)]
1255-
#[inline]
1255+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
12561256
unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) {
12571257
match resolver {
12581258
#(#resolve_arms,)*

rkyv_derive/src/deserialize.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn derive_deserialize_impl(
8383

8484
quote! {
8585
impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #deserialize_where {
86-
#[inline]
86+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
8787
fn deserialize(&self, deserializer: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> {
8888
Ok(#name {
8989
#(#deserialize_fields,)*
@@ -125,7 +125,7 @@ fn derive_deserialize_impl(
125125

126126
quote! {
127127
impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #deserialize_where {
128-
#[inline]
128+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
129129
fn deserialize(&self, deserializer: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> {
130130
Ok(#name(
131131
#(#deserialize_fields,)*
@@ -136,7 +136,7 @@ fn derive_deserialize_impl(
136136
}
137137
Fields::Unit => quote! {
138138
impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #where_clause {
139-
#[inline]
139+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
140140
fn deserialize(&self, _: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> {
141141
Ok(#name)
142142
}
@@ -238,7 +238,7 @@ fn derive_deserialize_impl(
238238

239239
quote! {
240240
impl #impl_generics Deserialize<#name #ty_generics, __D> for Archived<#name #ty_generics> #deserialize_where {
241-
#[inline]
241+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
242242
fn deserialize(&self, deserializer: &mut __D) -> ::core::result::Result<#name #ty_generics, __D::Error> {
243243
Ok(match self {
244244
#(#deserialize_variants,)*

rkyv_derive/src/serialize.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn derive_serialize_impl(
7777

7878
quote! {
7979
impl #impl_generics Serialize<__S> for #name #ty_generics #serialize_where {
80-
#[inline]
80+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
8181
fn serialize(&self, serializer: &mut __S) -> ::core::result::Result<Self::Resolver, __S::Error> {
8282
Ok(#resolver {
8383
#(#resolver_values,)*
@@ -107,7 +107,7 @@ fn derive_serialize_impl(
107107

108108
quote! {
109109
impl #impl_generics Serialize<__S> for #name #ty_generics #serialize_where {
110-
#[inline]
110+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
111111
fn serialize(&self, serializer: &mut __S) -> ::core::result::Result<Self::Resolver, __S::Error> {
112112
Ok(#resolver(
113113
#(#resolver_values,)*
@@ -119,7 +119,7 @@ fn derive_serialize_impl(
119119
Fields::Unit => {
120120
quote! {
121121
impl #impl_generics Serialize<__S> for #name #ty_generics #where_clause {
122-
#[inline]
122+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
123123
fn serialize(&self, serializer: &mut __S) -> ::core::result::Result<Self::Resolver, __S::Error> {
124124
Ok(#resolver)
125125
}
@@ -204,7 +204,7 @@ fn derive_serialize_impl(
204204

205205
quote! {
206206
impl #impl_generics Serialize<__S> for #name #ty_generics #serialize_where {
207-
#[inline]
207+
//#[inline] See https://github.com/rust-lang/rust/issues/91231
208208
fn serialize(&self, serializer: &mut __S) -> ::core::result::Result<Self::Resolver, __S::Error> {
209209
Ok(match self {
210210
#(#serialize_arms,)*

0 commit comments

Comments
 (0)