summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-02-13 18:48:43 -0800
committerGitHub <noreply@github.com>2017-02-13 18:48:43 -0800
commitf1caa107f463a548524572bd426fd7fe4e7d13f5 (patch)
tree185f6a7a702e9f7ac428163a0f5c6795f35df88f /src/codegen/mod.rs
parent696e2bb7970eac1520f828c5725f56ff1ebed576 (diff)
parentaf6d59c29a9b7a4c43ae857eb03b653cf598c852 (diff)
Auto merge of #513 - emilio:const-fn-arg, r=fitzgen
Use the constness of the inner type when converting array function args. Fixes https://github.com/servo/rust-bindgen/issues/509 I'm actually surprised we had no tests for this.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index b626fe34..92e34874 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -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())
},
TypeKind::Pointer(inner) => {
let inner = ctx.resolve_item(inner);