Skip to content
Myr

Merge pull request #2950 from aytey/fix_lifetime_issue_2024

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix temporary value lifetime in `serialize_struct`

authored by David Tolnay · committed by GitHub · parents 3f69251, 106da49 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:serde_derive/src/ser.rs+2 added-2 removed
1233 unmodified lines
1234 let wrapper_serialize = quote_spanned! {serialize_with.span()=>1235 #serialize_with(#(#self_var.values.#field_access, )* #serializer_var)1236 };12371238 quote!({1238 quote!(&{1239 #[doc(hidden)]1240 struct __SerializeWith #wrapper_impl_generics #where_clause {1241 values: (#(&'__a #field_tys, )*),1242 phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
8 unmodified lines
1251 #wrapper_serialize1252 }1253 }12541255 &__SerializeWith {1255 __SerializeWith {1256 values: (#(#field_exprs, )*),1257 phantom: _serde::__private::PhantomData::<#this_type #ty_generics>,1258 }1259 })
107 unmodified lines