Merge pull request #2950 from aytey/fix_lifetime_issue_2024

Fix temporary value lifetime in `serialize_struct`
This commit is contained in:
David Tolnay
2025-09-14 11:08:16 -07:00
committed by GitHub
+2 -2
View File
@@ -1235,7 +1235,7 @@ fn wrap_serialize_with(
#serialize_with(#(#self_var.values.#field_access, )* #serializer_var)
};
quote!({
quote!(&{
#[doc(hidden)]
struct __SerializeWith #wrapper_impl_generics #where_clause {
values: (#(&'__a #field_tys, )*),
@@ -1252,7 +1252,7 @@ fn wrap_serialize_with(
}
}
&__SerializeWith {
__SerializeWith {
values: (#(#field_exprs, )*),
phantom: _serde::__private::PhantomData::<#this_type #ty_generics>,
}