summaryrefslogtreecommitdiff
path: root/src/ir/function.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/function.rs')
-rw-r--r--src/ir/function.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs
index 50c442db..6e205f1b 100644
--- a/src/ir/function.rs
+++ b/src/ir/function.rs
@@ -165,8 +165,7 @@ impl FunctionSig {
let name = arg.spelling();
let name =
if name.is_empty() { None } else { Some(name) };
- let ty = Item::from_ty(&arg_ty, Some(*arg), None, ctx)
- .expect("Argument?");
+ let ty = Item::from_ty_or_ref(arg_ty, Some(*arg), None, ctx);
(name, ty)
})
.collect()
@@ -178,8 +177,7 @@ impl FunctionSig {
cursor.visit(|c| {
if c.kind() == CXCursor_ParmDecl {
let ty =
- Item::from_ty(&c.cur_type(), Some(c), None, ctx)
- .expect("ParmDecl?");
+ Item::from_ty_or_ref(c.cur_type(), Some(c), None, ctx);
let name = c.spelling();
let name =
if name.is_empty() { None } else { Some(name) };
@@ -218,7 +216,7 @@ impl FunctionSig {
}
let ty_ret_type = try!(ty.ret_type().ok_or(ParseError::Continue));
- let ret = try!(Item::from_ty(&ty_ret_type, None, None, ctx));
+ let ret = Item::from_ty_or_ref(ty_ret_type, None, None, ctx);
let abi = get_abi(ty.call_conv());
Ok(Self::new(ret, args, ty.is_variadic(), abi))