diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 7db083e728..fb6c839d84 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 300edd3931..b34e217f4a 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 e16a23d71d..4c9dc8f6c2 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 714467f6f3..51531824cb 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 0c4109776d..e5d3ace2fc 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 6896eb31c9..b3119ca7ad 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 e7ae9f4a73..625abe3bde 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 716ce39f5c..0faf37ac33 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 {