diff --git a/CHANGELOG.md b/CHANGELOG.md index a14079928b..009d9175f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ incremented for features. ## [Unreleased] +### Features + +* lang: Ignore `Unnamed` structs instead of panic ([#605](https://github.com/project-serum/anchor/pull/605)). + ## [0.13.2] - 2021-08-11 ### Fixes diff --git a/lang/syn/src/idl/file.rs b/lang/syn/src/idl/file.rs index f0eb0badfd..8789ccc05a 100644 --- a/lang/syn/src/idl/file.rs +++ b/lang/syn/src/idl/file.rs @@ -384,7 +384,8 @@ fn parse_ty_defs(ctx: &CrateContext) -> Result> { }) }) .collect::>>(), - _ => panic!("Only named structs are allowed."), + syn::Fields::Unnamed(_) => return None, + _ => panic!("Empty structs are allowed."), }; Some(fields.map(|fields| IdlTypeDefinition {