Skip to content

Commit d7ac944

Browse files
authored
lang: Ignore unnamed structs instead of panic (otter-sec#605)
1 parent 0ad21da commit d7ac944

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ incremented for features.
1111

1212
## [Unreleased]
1313

14+
### Features
15+
16+
* lang: Ignore `Unnamed` structs instead of panic ([#605](https://github.com/project-serum/anchor/pull/605)).
17+
1418
## [0.13.2] - 2021-08-11
1519

1620
### Fixes

lang/syn/src/idl/file.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ fn parse_ty_defs(ctx: &CrateContext) -> Result<Vec<IdlTypeDefinition>> {
384384
})
385385
})
386386
.collect::<Result<Vec<IdlField>>>(),
387-
_ => panic!("Only named structs are allowed."),
387+
syn::Fields::Unnamed(_) => return None,
388+
_ => panic!("Empty structs are allowed."),
388389
};
389390

390391
Some(fields.map(|fields| IdlTypeDefinition {

0 commit comments

Comments
 (0)