summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/codegen/mod.rs10
-rw-r--r--tests/expectations/tests/enum_and_vtable_mangling.rs4
-rw-r--r--tests/expectations/tests/nested_vtable.rs4
-rw-r--r--tests/expectations/tests/ref_argument_array.rs4
-rw-r--r--tests/expectations/tests/virtual_dtor.rs4
-rw-r--r--tests/expectations/tests/virtual_inheritance.rs8
-rw-r--r--tests/expectations/tests/virtual_overloaded.rs4
-rw-r--r--tests/expectations/tests/vtable_recursive_sig.rs4
8 files changed, 12 insertions, 30 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 7db083e7..fb6c839d 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -706,17 +706,15 @@ impl<'a> CodeGenerator for Vtable<'a> {
assert_eq!(item.id(), self.item_id);
// For now, generate an empty struct, later we should generate function
// pointers and whatnot.
- let mut attributes = vec![attributes::repr("C")];
-
- if ctx.options().derive_default {
- attributes.push(attributes::derives(&["Default"]))
- }
+ let attributes = vec![attributes::repr("C")];
let vtable = aster::AstBuilder::new()
.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);
}
diff --git a/tests/expectations/tests/enum_and_vtable_mangling.rs b/tests/expectations/tests/enum_and_vtable_mangling.rs
index 300edd39..b34e217f 100644
--- a/tests/expectations/tests/enum_and_vtable_mangling.rs
+++ b/tests/expectations/tests/enum_and_vtable_mangling.rs
@@ -10,9 +10,7 @@ pub const whatever_else: _bindgen_ty_1 = _bindgen_ty_1::whatever_else;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_1 { match_ = 0, whatever_else = 1, }
#[repr(C)]
-#[derive(Default)]
-pub struct C__bindgen_vtable {
-}
+pub struct C__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct C {
diff --git a/tests/expectations/tests/nested_vtable.rs b/tests/expectations/tests/nested_vtable.rs
index e16a23d7..4c9dc8f6 100644
--- a/tests/expectations/tests/nested_vtable.rs
+++ b/tests/expectations/tests/nested_vtable.rs
@@ -5,9 +5,7 @@
#[repr(C)]
-#[derive(Default)]
-pub struct nsISupports__bindgen_vtable {
-}
+pub struct nsISupports__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsISupports {
diff --git a/tests/expectations/tests/ref_argument_array.rs b/tests/expectations/tests/ref_argument_array.rs
index 714467f6..51531824 100644
--- a/tests/expectations/tests/ref_argument_array.rs
+++ b/tests/expectations/tests/ref_argument_array.rs
@@ -6,9 +6,7 @@
pub const NSID_LENGTH: ::std::os::raw::c_uint = 10;
#[repr(C)]
-#[derive(Default)]
-pub struct nsID__bindgen_vtable {
-}
+pub struct nsID__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsID {
diff --git a/tests/expectations/tests/virtual_dtor.rs b/tests/expectations/tests/virtual_dtor.rs
index 0c410977..e5d3ace2 100644
--- a/tests/expectations/tests/virtual_dtor.rs
+++ b/tests/expectations/tests/virtual_dtor.rs
@@ -5,9 +5,7 @@
#[repr(C)]
-#[derive(Default)]
-pub struct nsSlots__bindgen_vtable {
-}
+pub struct nsSlots__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug)]
pub struct nsSlots {
diff --git a/tests/expectations/tests/virtual_inheritance.rs b/tests/expectations/tests/virtual_inheritance.rs
index 6896eb31..b3119ca7 100644
--- a/tests/expectations/tests/virtual_inheritance.rs
+++ b/tests/expectations/tests/virtual_inheritance.rs
@@ -25,9 +25,7 @@ impl Clone for A {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Default)]
-pub struct B__bindgen_vtable {
-}
+pub struct B__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct B {
@@ -53,9 +51,7 @@ impl Default for B {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Default)]
-pub struct C__bindgen_vtable {
-}
+pub struct C__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct C {
diff --git a/tests/expectations/tests/virtual_overloaded.rs b/tests/expectations/tests/virtual_overloaded.rs
index e7ae9f4a..625abe3b 100644
--- a/tests/expectations/tests/virtual_overloaded.rs
+++ b/tests/expectations/tests/virtual_overloaded.rs
@@ -5,9 +5,7 @@
#[repr(C)]
-#[derive(Default)]
-pub struct C__bindgen_vtable {
-}
+pub struct C__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct C {
diff --git a/tests/expectations/tests/vtable_recursive_sig.rs b/tests/expectations/tests/vtable_recursive_sig.rs
index 716ce39f..0faf37ac 100644
--- a/tests/expectations/tests/vtable_recursive_sig.rs
+++ b/tests/expectations/tests/vtable_recursive_sig.rs
@@ -23,9 +23,7 @@ impl Default for Derived {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Default)]
-pub struct Base__bindgen_vtable {
-}
+pub struct Base__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Base {