summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-03-20 18:35:13 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-03-21 14:46:46 +0100
commitf67967a2930082ef54cde03d26dc3c0fe8f388cd (patch)
treeb38b64cefc739a1ab0547727016cb9ebc948afc1 /src/codegen/mod.rs
parent1abd864972012b2c027fc3378f1db88333f5d6ea (diff)
Make vtables non-zero-size to fix a rustc warning.
``` warning: found non-foreign-function-safe member in struct marked #[repr(C)]: found zero-size struct in foreign module, consider adding a member to this struct ```
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 577b8aab..fb6c839d 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -712,7 +712,9 @@ impl<'a> CodeGenerator for Vtable<'a> {
.item()
.pub_()
.with_attrs(attributes)
- .struct_(self.canonical_name(ctx))
+ .tuple_struct(self.canonical_name(ctx))
+ .field()
+ .build_ty(helpers::ast_ty::raw_type(ctx, "c_void"))
.build();
result.push(vtable);
}