Skip to content

Commit 386b192

Browse files
committed
Allow building vtables from TaggedStructure
1 parent b681cbf commit 386b192

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

sys/src/api/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ type ReturnCode_t = ReturnCode;
1919
/// # Safety
2020
/// This trait must only be implemented for types that contain a [`Header`], have a valid
2121
/// [`StructType_t`], and are safe to be zero-initialized.
22-
pub unsafe trait TaggedStructure: Sized {
22+
pub unsafe trait TaggedStructure {
2323
const TAG: StructType_t;
2424
fn header_mut(&mut self) -> &mut Header;
2525

26-
fn new() -> Self {
26+
fn new() -> Self
27+
where
28+
Self: Sized,
29+
{
2730
// Original bindgen implementation
2831
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
2932
let mut s = unsafe {

0 commit comments

Comments
 (0)