We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 696e2bb + af6d59c commit f1caa10Copy full SHA for f1caa10
src/codegen/mod.rs
@@ -2828,7 +2828,7 @@ mod utils {
2828
// [1]: http://c0x.coding-guidelines.com/6.7.5.3.html
2829
let arg_ty = match *arg_ty.canonical_type(ctx).kind() {
2830
TypeKind::Array(t, _) => {
2831
- 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())
2832
},
2833
TypeKind::Pointer(inner) => {
2834
let inner = ctx.resolve_item(inner);
tests/expectations/tests/const_array_fn_arg.rs
@@ -0,0 +1,9 @@
1
+/* automatically generated by rust-bindgen */
2
+
3
4
+#![allow(non_snake_case)]
5
6
7
+extern "C" {
8
+ pub fn f(a: *const ::std::os::raw::c_int);
9
+}
tests/headers/const_array_fn_arg.h
@@ -0,0 +1 @@
+void f(const int a[]);
0 commit comments