diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2016-12-29 18:03:01 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2016-12-29 18:03:01 +0100 |
commit | 17e20030ea99c7ad036af1aa65110f315f13c61c (patch) | |
tree | 205748e1082958f4a33ab5071e42e6e2d5fe81b1 /libbindgen/src/codegen/mod.rs | |
parent | f7a328a2406e98d93a10453c613f675ce51471a9 (diff) |
codegen: Use the canonical type to determine whether we should convert to a pointer an argument.
Fixes https://github.com/Yamakaky/rust-bindgen/issues/407
Diffstat (limited to 'libbindgen/src/codegen/mod.rs')
-rw-r--r-- | libbindgen/src/codegen/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libbindgen/src/codegen/mod.rs b/libbindgen/src/codegen/mod.rs index 69d5f651..b03c9f21 100644 --- a/libbindgen/src/codegen/mod.rs +++ b/libbindgen/src/codegen/mod.rs @@ -1945,7 +1945,7 @@ impl ToRustTy for FunctionSig { // the array type derivation. // // [1]: http://c0x.coding-guidelines.com/6.7.5.3.html - let arg_ty = if let TypeKind::Array(t, _) = *arg_ty.kind() { + let arg_ty = if let TypeKind::Array(t, _) = *arg_ty.canonical_type(ctx).kind() { t.to_rust_ty(ctx).to_ptr(arg_ty.is_const(), ctx.span()) } else { arg_item.to_rust_ty(ctx) |