bytemuck/
zeroable_in_option.rs1use super::*;
2
3unsafe impl<T: ZeroableInOption> Zeroable for Option<T> {}
5
6pub unsafe trait ZeroableInOption: Sized {}
14
15unsafe impl ZeroableInOption for NonZeroI8 {}
16unsafe impl ZeroableInOption for NonZeroI16 {}
17unsafe impl ZeroableInOption for NonZeroI32 {}
18unsafe impl ZeroableInOption for NonZeroI64 {}
19unsafe impl ZeroableInOption for NonZeroI128 {}
20unsafe impl ZeroableInOption for NonZeroIsize {}
21unsafe impl ZeroableInOption for NonZeroU8 {}
22unsafe impl ZeroableInOption for NonZeroU16 {}
23unsafe impl ZeroableInOption for NonZeroU32 {}
24unsafe impl ZeroableInOption for NonZeroU64 {}
25unsafe impl ZeroableInOption for NonZeroU128 {}
26unsafe impl ZeroableInOption for NonZeroUsize {}
27
28unsafe impl<T: ?Sized> ZeroableInOption for NonNull<T> {}
30unsafe impl<T: ?Sized> ZeroableInOption for &'_ T {}
31unsafe impl<T: ?Sized> ZeroableInOption for &'_ mut T {}
32
33#[cfg(feature = "extern_crate_alloc")]
34#[cfg_attr(feature = "nightly_docs", doc(cfg(feature = "extern_crate_alloc")))]
35unsafe impl<T: ?Sized> ZeroableInOption for alloc::boxed::Box<T> {}