Эх сурвалжийг харах

lang: Make tuple struct fields public in `declare_program!` (#2994)

cryptopapi997 1 жил өмнө
parent
commit
56017029b4

+ 1 - 0
CHANGELOG.md

@@ -37,6 +37,7 @@ The minor version will be incremented upon a breaking change and the patch versi
 - lang: Fix instruction return type generation with `declare_program!` ([#2977](https://github.com/coral-xyz/anchor/pull/2977)).
 - cli: Fix IDL write getting corrupted from retries ([#2964](https://github.com/coral-xyz/anchor/pull/2964)).
 - idl: Fix `unexpected_cfgs` build warning ([#2992](https://github.com/coral-xyz/anchor/pull/2992)).
+- lang: Make tuple struct fields public in `declare_program!` ([#2994](https://github.com/coral-xyz/anchor/pull/2994)).
 
 ### Breaking
 

+ 5 - 1
lang/attribute/program/src/declare_program/common.rs

@@ -211,7 +211,11 @@ pub fn convert_idl_type_def_to_ts(
                     }
                 },
                 |tys| {
-                    let tys = tys.iter().map(convert_idl_type_to_syn_type);
+                    let tys = tys
+                        .iter()
+                        .map(convert_idl_type_to_syn_type)
+                        .map(|ty| quote! { pub #ty });
+
                     quote! {
                         #declare_struct (#(#tys,)*);
                     }