lang: Fix using `bytemuckunsafe` account serialization with `declare_program!` (#3037)

This commit is contained in:
Burbo 2024-06-19 22:57:10 +02:00 committed by GitHub
parent f326b89c48
commit 9c17d65a76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -52,6 +52,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- ts: Fix using IDLs that have defined types as generic arguments ([#3016](https://github.com/coral-xyz/anchor/pull/3016)).
- idl: Fix generation with unsupported expressions ([#3033](https://github.com/coral-xyz/anchor/pull/3033)).
- idl: Fix using `address` constraint with field expressions ([#3034](https://github.com/coral-xyz/anchor/pull/3034)).
- lang: Fix using `bytemuckunsafe` account serialization with `declare_program!` ([#3037](https://github.com/coral-xyz/anchor/pull/3037)).
### Breaking

View File

@ -62,8 +62,8 @@ pub fn gen_accounts_mod(idl: &Idl) -> proc_macro2::TokenStream {
matches!(ty_def.serialization, IdlSerialization::BytemuckUnsafe)
.then(|| {
quote! {
unsafe impl anchor_lang::__private::Pod for #name {}
unsafe impl anchor_lang::__private::Zeroable for #name {}
unsafe impl anchor_lang::__private::bytemuck::Pod for #name {}
unsafe impl anchor_lang::__private::bytemuck::Zeroable for #name {}
}
})
.unwrap_or_default();