MaybeUninit has to wait for later.

This commit is contained in:
Lokathor 2019-11-25 19:21:38 -07:00
parent 37380f8867
commit de517daffa
3 changed files with 9 additions and 1 deletions

View File

@ -8,3 +8,7 @@
# bytemuck
A crate for mucking around with piles of bytes.
## Stability
The goal is to stay at 1.0 until at least the next edition of Rust.

View File

@ -62,6 +62,8 @@ unsafe impl<T: 'static> Pod for Option<NonNull<T>> {}
unsafe impl<T: Pod> Pod for PhantomData<T> {}
unsafe impl<T: Pod> Pod for ManuallyDrop<T> {}
// Note(Lokathor): MaybeUninit can NEVER be Pod.
impl_unsafe_marker_for_array!(
Pod, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 48, 64, 96, 128, 256,

View File

@ -60,7 +60,9 @@ unsafe impl<T> Zeroable for *const T {}
unsafe impl<T> Zeroable for Option<NonNull<T>> {}
unsafe impl<T: Zeroable> Zeroable for PhantomData<T> {}
unsafe impl<T: Zeroable> Zeroable for ManuallyDrop<T> {}
unsafe impl<T> Zeroable for MaybeUninit<T> {}
// 2.0: add MaybeUninit
//unsafe impl<T> Zeroable for MaybeUninit<T> {}
unsafe impl<A: Zeroable> Zeroable for (A,) {}
unsafe impl<A: Zeroable, B: Zeroable> Zeroable for (A, B) {}