summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWangshan Lu <wisagan@gmail.com>2017-08-01 15:54:32 +0800
committerWangshan Lu <wisagan@gmail.com>2017-08-01 15:54:32 +0800
commit06b38938739e3da90ba3bb3ba1958c24241ac0dc (patch)
tree7d2390d1611b920d1e7f5172c5a2645b693d28d1 /src
parentcc938cb9bf656b49aecf1d569084b12ad56048d4 (diff)
Not derive Copy for C flexible array member
Diffstat (limited to 'src')
-rw-r--r--src/ir/ty.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index b53e27bf..13b5f2ee 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -531,7 +531,8 @@ impl<'a> CanDeriveCopy<'a> for Type {
fn can_derive_copy(&self, ctx: &BindgenContext, item: &Item) -> bool {
match self.kind {
- TypeKind::Array(t, _) => {
+ TypeKind::Array(t, len) => {
+ len > 0 &&
t.can_derive_copy_in_array(ctx, ())
}
TypeKind::ResolvedTypeRef(t) |