summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbindgen/src/ir/enum_ty.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbindgen/src/ir/enum_ty.rs b/libbindgen/src/ir/enum_ty.rs
index 33a4fcfa..14ca4965 100644
--- a/libbindgen/src/ir/enum_ty.rs
+++ b/libbindgen/src/ir/enum_ty.rs
@@ -49,8 +49,11 @@ impl Enum {
}
let declaration = ty.declaration().canonical();
- let et = &declaration.enum_type().expect("Expected an enum type");
- let repr = Item::from_ty(et, None, None, ctx).ok();
+ let et = declaration.enum_type();
+ if et.is_none() {
+ return Err(ParseError::Continue);
+ }
+ let repr = Item::from_ty(&et.unwrap(), None, None, ctx).ok();
let mut variants = vec![];
let is_signed = match repr {