mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 17:51:01 +00:00
Merge pull request #2950 from aytey/fix_lifetime_issue_2024
Fix temporary value lifetime in `serialize_struct`
This commit is contained in:
@@ -1235,7 +1235,7 @@ fn wrap_serialize_with(
|
|||||||
#serialize_with(#(#self_var.values.#field_access, )* #serializer_var)
|
#serialize_with(#(#self_var.values.#field_access, )* #serializer_var)
|
||||||
};
|
};
|
||||||
|
|
||||||
quote!({
|
quote!(&{
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
struct __SerializeWith #wrapper_impl_generics #where_clause {
|
struct __SerializeWith #wrapper_impl_generics #where_clause {
|
||||||
values: (#(&'__a #field_tys, )*),
|
values: (#(&'__a #field_tys, )*),
|
||||||
@@ -1252,7 +1252,7 @@ fn wrap_serialize_with(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__SerializeWith {
|
__SerializeWith {
|
||||||
values: (#(#field_exprs, )*),
|
values: (#(#field_exprs, )*),
|
||||||
phantom: _serde::__private::PhantomData::<#this_type #ty_generics>,
|
phantom: _serde::__private::PhantomData::<#this_type #ty_generics>,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user