diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-24 11:51:34 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-24 11:51:34 +0100 |
commit | 15630c6562d8a1f2f95169a09344ef6e2becd56c (patch) | |
tree | de09082a4df8ca23ab5669c716591f4462cafbca /src/ir/function.rs | |
parent | f804f9eb6fcd7caf032b337c448e7314d3247664 (diff) |
Make it work in rust stable, and incidentally fix #425
The problem with #425 was the following:
We were parsing the methods after reaching the JS::Value definition.
Those methods contained a JSWhyMagic that we hadn't seen, so we parsed it as
being in the JS:: module.
Diffstat (limited to 'src/ir/function.rs')
-rw-r--r-- | src/ir/function.rs | 8 |
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)) |