diff --git a/src/maybe_uninit.rs b/src/maybe_uninit.rs index 71ec8f0..39c6366 100644 --- a/src/maybe_uninit.rs +++ b/src/maybe_uninit.rs @@ -7,6 +7,7 @@ use std::mem::ManuallyDrop; /// this wraps a value that can be wholly or partially uninitialized; /// it also has no drop regardless of the type of T. #[derive(Copy)] +#[repr(C)] // for cast from self ptr to value pub union MaybeUninit { empty: (), value: ManuallyDrop,