diff options
-rw-r--r-- | bindgen/ir/ty.rs | 3 | ||||
-rw-r--r-- | bindgen/ir/var.rs | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/bindgen/ir/ty.rs b/bindgen/ir/ty.rs index 9edc43d4..c9403f66 100644 --- a/bindgen/ir/ty.rs +++ b/bindgen/ir/ty.rs @@ -1145,8 +1145,7 @@ impl Type { location, None, ctx, - ) - .expect("Not able to resolve vector element?"); + )?; TypeKind::Vector(inner, ty.num_elements().unwrap()) } CXType_ConstantArray => { diff --git a/bindgen/ir/var.rs b/bindgen/ir/var.rs index 198206b9..c86742ff 100644 --- a/bindgen/ir/var.rs +++ b/bindgen/ir/var.rs @@ -293,11 +293,11 @@ impl ClangSubItemParser for Var { let ty = match Item::from_ty(&ty, cursor, None, ctx) { Ok(ty) => ty, Err(e) => { - assert_eq!( - ty.kind(), - CXType_Auto, + assert!( + matches!(ty.kind(), CXType_Auto | CXType_Unexposed), "Couldn't resolve constant type, and it \ - wasn't an nondeductible auto type!" + wasn't an nondeductible auto type or unexposed \ + type!" ); return Err(e); } |