mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-22 14:52:50 +00:00
opt-in zeroable for maybe_unint
This commit is contained in:
parent
6414f14815
commit
4d819357ba
@ -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
|
||||||
|
@ -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) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user