Browse Source

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

Burbo 1 year ago
parent
commit
9c17d65a76
2 changed files with 3 additions and 2 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 2
      lang/attribute/program/src/declare_program/mods/accounts.rs

+ 1 - 0
CHANGELOG.md

@@ -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
 

+ 2 - 2
lang/attribute/program/src/declare_program/mods/accounts.rs

@@ -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();