diff options
author | Emilio Cobos Álvarez <me@emiliocobos.me> | 2016-04-08 01:24:23 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <me@emiliocobos.me> | 2016-04-08 01:24:23 +0200 |
commit | 62484861999e6eca13b1fbe0436111f10684b372 (patch) | |
tree | ff448ad85afd935330634b9cb990277e03b621b0 | |
parent | 7592660c84ed0b54750525def8172de12234f545 (diff) |
parser: Anonymous structs are legal too
-rw-r--r-- | src/parser.rs | 2 | ||||
-rw-r--r-- | src/types.rs | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/parser.rs b/src/parser.rs index 5aafd751..acd3a694 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -640,7 +640,7 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor, ci.members.push(CompMember::Comp(decl.compinfo())); // Anonymous structs are legal in both C++ and C11 - if ci2.borrow().kind == CompKind::Union && ci2.borrow().was_unnamed { + if ci2.borrow().was_unnamed { let ci2b = ci2.borrow(); let field = FieldInfo::new(ci2b.name.clone(), TComp(ci2.clone()), ci2b.comment.clone(), None); ci.members.push(CompMember::Field(field)); diff --git a/src/types.rs b/src/types.rs index 9acf942e..54fce61c 100644 --- a/src/types.rs +++ b/src/types.rs @@ -202,7 +202,6 @@ impl Type { }) } - #[allow(dead_code)] pub fn can_derive_debug(&self) -> bool { match *self { TArray(_, size, _) => size <= 32, |