mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-21 22:32:23 +00:00
implement NoUninit for NonZero* (#107)
This commit is contained in:
parent
21e2ac55d7
commit
d691aa6a14
@ -1,4 +1,18 @@
|
|||||||
use crate::Pod;
|
use crate::Pod;
|
||||||
|
use core::num::{
|
||||||
|
NonZeroU8,
|
||||||
|
NonZeroI8,
|
||||||
|
NonZeroU16,
|
||||||
|
NonZeroI16,
|
||||||
|
NonZeroU32,
|
||||||
|
NonZeroI32,
|
||||||
|
NonZeroU64,
|
||||||
|
NonZeroI64,
|
||||||
|
NonZeroU128,
|
||||||
|
NonZeroI128,
|
||||||
|
NonZeroUsize,
|
||||||
|
NonZeroIsize,
|
||||||
|
};
|
||||||
|
|
||||||
/// Marker trait for "plain old data" types with no uninit (or padding) bytes.
|
/// Marker trait for "plain old data" types with no uninit (or padding) bytes.
|
||||||
///
|
///
|
||||||
@ -57,3 +71,16 @@ unsafe impl<T: Pod> NoUninit for T {}
|
|||||||
unsafe impl NoUninit for char {}
|
unsafe impl NoUninit for char {}
|
||||||
|
|
||||||
unsafe impl NoUninit for bool {}
|
unsafe impl NoUninit for bool {}
|
||||||
|
|
||||||
|
unsafe impl NoUninit for NonZeroU8 {}
|
||||||
|
unsafe impl NoUninit for NonZeroI8 {}
|
||||||
|
unsafe impl NoUninit for NonZeroU16 {}
|
||||||
|
unsafe impl NoUninit for NonZeroI16 {}
|
||||||
|
unsafe impl NoUninit for NonZeroU32 {}
|
||||||
|
unsafe impl NoUninit for NonZeroI32 {}
|
||||||
|
unsafe impl NoUninit for NonZeroU64 {}
|
||||||
|
unsafe impl NoUninit for NonZeroI64 {}
|
||||||
|
unsafe impl NoUninit for NonZeroU128 {}
|
||||||
|
unsafe impl NoUninit for NonZeroI128 {}
|
||||||
|
unsafe impl NoUninit for NonZeroUsize {}
|
||||||
|
unsafe impl NoUninit for NonZeroIsize {}
|
Loading…
Reference in New Issue
Block a user