Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,7 @@ mod utils {
// [1]: http://c0x.coding-guidelines.com/6.7.5.3.html
let arg_ty = match *arg_ty.canonical_type(ctx).kind() {
TypeKind::Array(t, _) => {
t.to_rust_ty(ctx).to_ptr(arg_ty.is_const(), ctx.span())
t.to_rust_ty(ctx).to_ptr(ctx.resolve_type(t).is_const(), ctx.span())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dat copy paste

},
TypeKind::Pointer(inner) => {
let inner = ctx.resolve_item(inner);
Expand Down
9 changes: 9 additions & 0 deletions tests/expectations/tests/const_array_fn_arg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* automatically generated by rust-bindgen */


#![allow(non_snake_case)]


extern "C" {
pub fn f(a: *const ::std::os::raw::c_int);
}
1 change: 1 addition & 0 deletions tests/headers/const_array_fn_arg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void f(const int a[]);