diff options
author | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
commit | a990de90fe41456a23e58bd087d2f107d321f3a1 (patch) | |
tree | 15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/bytemuck/src/zeroable_in_option.rs | |
parent | 3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff) | |
download | fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip |
Deleted vendor folder
Diffstat (limited to 'vendor/bytemuck/src/zeroable_in_option.rs')
-rw-r--r-- | vendor/bytemuck/src/zeroable_in_option.rs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/vendor/bytemuck/src/zeroable_in_option.rs b/vendor/bytemuck/src/zeroable_in_option.rs deleted file mode 100644 index c4cf158..0000000 --- a/vendor/bytemuck/src/zeroable_in_option.rs +++ /dev/null @@ -1,35 +0,0 @@ -use super::*; - -// Note(Lokathor): This is the neat part!! -unsafe impl<T: ZeroableInOption> Zeroable for Option<T> {} - -/// Trait for types which are [Zeroable](Zeroable) when wrapped in -/// [Option](core::option::Option). -/// -/// ## Safety -/// -/// * `Option<YourType>` must uphold the same invariants as -/// [Zeroable](Zeroable). -pub unsafe trait ZeroableInOption: Sized {} - -unsafe impl ZeroableInOption for NonZeroI8 {} -unsafe impl ZeroableInOption for NonZeroI16 {} -unsafe impl ZeroableInOption for NonZeroI32 {} -unsafe impl ZeroableInOption for NonZeroI64 {} -unsafe impl ZeroableInOption for NonZeroI128 {} -unsafe impl ZeroableInOption for NonZeroIsize {} -unsafe impl ZeroableInOption for NonZeroU8 {} -unsafe impl ZeroableInOption for NonZeroU16 {} -unsafe impl ZeroableInOption for NonZeroU32 {} -unsafe impl ZeroableInOption for NonZeroU64 {} -unsafe impl ZeroableInOption for NonZeroU128 {} -unsafe impl ZeroableInOption for NonZeroUsize {} - -// Note: this does not create NULL vtable because we get `None` anyway. -unsafe impl<T: ?Sized> ZeroableInOption for NonNull<T> {} -unsafe impl<T: ?Sized> ZeroableInOption for &'_ T {} -unsafe impl<T: ?Sized> ZeroableInOption for &'_ mut T {} - -#[cfg(feature = "extern_crate_alloc")] -#[cfg_attr(feature = "nightly_docs", doc(cfg(feature = "extern_crate_alloc")))] -unsafe impl<T: ?Sized> ZeroableInOption for alloc::boxed::Box<T> {} |