opt-in zeroable for maybe_unint

This commit is contained in:
Lokathor 2020-08-19 21:43:44 -06:00
parent 6414f14815
commit 4d819357ba
2 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@ exclude = ["/pedantic.bat"]
# Note: Yeah these names are non-standard, we'll fix it in v2 some day maybe # Note: Yeah these names are non-standard, we'll fix it in v2 some day maybe
extern_crate_alloc = [] extern_crate_alloc = []
extern_crate_std = ["extern_crate_alloc"] extern_crate_std = ["extern_crate_alloc"]
zeroable_maybe_uninit = []
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true

View File

@ -61,8 +61,8 @@ unsafe impl<T> Zeroable for Option<NonNull<T>> {}
unsafe impl<T: Zeroable> Zeroable for PhantomData<T> {} unsafe impl<T: Zeroable> Zeroable for PhantomData<T> {}
unsafe impl<T: Zeroable> Zeroable for ManuallyDrop<T> {} unsafe impl<T: Zeroable> Zeroable for ManuallyDrop<T> {}
// 2.0: add MaybeUninit #[cfg(feature = "zeroable_maybe_uninit")]
//unsafe impl<T> Zeroable for MaybeUninit<T> {} unsafe impl<T> Zeroable for core::mem::MaybeUninit<T> {}
unsafe impl<A: Zeroable> Zeroable for (A,) {} unsafe impl<A: Zeroable> Zeroable for (A,) {}
unsafe impl<A: Zeroable, B: Zeroable> Zeroable for (A, B) {} unsafe impl<A: Zeroable, B: Zeroable> Zeroable for (A, B) {}