Skip to content

Commit 924c740

Browse files
committed
Followed Resolved Type Ref instead of panicking
1 parent 96e5d77 commit 924c740

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libbindgen/src/codegen/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,11 @@ impl CodeGenerator for Function {
20052005
let signature = signature_item.kind().expect_type();
20062006
let signature = match *signature.kind() {
20072007
TypeKind::Function(ref sig) => sig,
2008-
_ => panic!("How?"),
2008+
TypeKind::ResolvedTypeRef(ref item_id) => {
2009+
let item = ctx.resolve_item(*item_id);
2010+
return self.codegen(ctx, result, _whitelisted_items, item);
2011+
},
2012+
_ => panic!("How?")
20092013
};
20102014

20112015
let fndecl = utils::rust_fndecl_from_signature(ctx, signature_item);

0 commit comments

Comments
 (0)