pub unsafe trait StableLayout {}
unsafe impl StableLayout for u8 {}
unsafe impl StableLayout for u16 {}
unsafe impl StableLayout for u32 {}
unsafe impl StableLayout for u64 {}
unsafe impl StableLayout for usize {}
unsafe impl StableLayout for i8 {}
unsafe impl StableLayout for i16 {}
unsafe impl StableLayout for i32 {}
unsafe impl StableLayout for i64 {}
unsafe impl StableLayout for isize {}
unsafe impl StableLayout for f32 {}
unsafe impl StableLayout for f64 {}
unsafe impl StableLayout for bool {}
unsafe impl StableLayout for char {}
unsafe impl StableLayout for () {}
use core::marker::PhantomData;
unsafe impl<T> StableLayout for PhantomData<T> where T: StableLayout {}
use core::num::Wrapping;
unsafe impl<T> StableLayout for Wrapping<T> where T: StableLayout {}
use core::mem::ManuallyDrop;
unsafe impl<T> StableLayout for ManuallyDrop<T> where T: StableLayout {}
use core::num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
unsafe impl StableLayout for NonZeroU8 {}
unsafe impl StableLayout for NonZeroU16 {}
unsafe impl StableLayout for NonZeroU32 {}
unsafe impl StableLayout for NonZeroU64 {}
unsafe impl StableLayout for NonZeroUsize {}
unsafe impl StableLayout for Option<NonZeroU8> {}
unsafe impl StableLayout for Option<NonZeroU16> {}
unsafe impl StableLayout for Option<NonZeroU32> {}
unsafe impl StableLayout for Option<NonZeroU64> {}
unsafe impl StableLayout for Option<NonZeroUsize> {}
use core::num::{NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize};
unsafe impl StableLayout for NonZeroI8 {}
unsafe impl StableLayout for NonZeroI16 {}
unsafe impl StableLayout for NonZeroI32 {}
unsafe impl StableLayout for NonZeroI64 {}
unsafe impl StableLayout for NonZeroIsize {}
unsafe impl StableLayout for Option<NonZeroI8> {}
unsafe impl StableLayout for Option<NonZeroI16> {}
unsafe impl StableLayout for Option<NonZeroI32> {}
unsafe impl StableLayout for Option<NonZeroI64> {}
unsafe impl StableLayout for Option<NonZeroIsize> {}
unsafe impl<T> StableLayout for &T where T: Sized + StableLayout {}
unsafe impl<T> StableLayout for Option<&T> where T: Sized + StableLayout {}
unsafe impl<T> StableLayout for &mut T where T: Sized + StableLayout {}
unsafe impl<T> StableLayout for Option<&mut T> where T: Sized + StableLayout {}
unsafe impl<T> StableLayout for *const T where T: Sized + StableLayout {}
unsafe impl<T> StableLayout for *mut T where T: Sized + StableLayout {}
use core::ptr::NonNull;
unsafe impl<T> StableLayout for NonNull<T> where T: Sized + StableLayout {}
unsafe impl<T> StableLayout for Option<NonNull<T>> where T: Sized + StableLayout {}
use core::cell::{Cell, UnsafeCell};
unsafe impl<T> StableLayout for UnsafeCell<T> where T: StableLayout {}
unsafe impl<T> StableLayout for Cell<T> where T: StableLayout {}
#[cfg(feature = "unsafe_alloc")]
use alloc::boxed::Box;
#[cfg(feature = "unsafe_alloc")]
unsafe impl<T> StableLayout for Box<T> where T: Sized + StableLayout {}
#[cfg(feature = "unsafe_alloc")]
unsafe impl<T> StableLayout for Option<Box<T>> where T: Sized + StableLayout {}
macro_rules! impl_unsafe_marker_for_array {
( $marker:ident , $( $n:expr ),* ) => {
$(unsafe impl<T> $marker for [T; $n] where T: $marker {})*
}
}
#[rustfmt::skip]
impl_unsafe_marker_for_array!(
StableLayout, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
48, 64, 96, 128, 256, 512, 1024, 2048, 4096
);
#[cfg(target_arch = "x86")]
use core::arch::x86;
#[cfg(target_arch = "x86")]
unsafe impl StableLayout for x86::__m128i {}
#[cfg(target_arch = "x86")]
unsafe impl StableLayout for x86::__m128 {}
#[cfg(target_arch = "x86")]
unsafe impl StableLayout for x86::__m128d {}
#[cfg(target_arch = "x86")]
unsafe impl StableLayout for x86::__m256i {}
#[cfg(target_arch = "x86")]
unsafe impl StableLayout for x86::__m256 {}
#[cfg(target_arch = "x86")]
unsafe impl StableLayout for x86::__m256d {}
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64;
#[cfg(target_arch = "x86_64")]
unsafe impl StableLayout for x86_64::__m128i {}
#[cfg(target_arch = "x86_64")]
unsafe impl StableLayout for x86_64::__m128 {}
#[cfg(target_arch = "x86_64")]
unsafe impl StableLayout for x86_64::__m128d {}
#[cfg(target_arch = "x86_64")]
unsafe impl StableLayout for x86_64::__m256i {}
#[cfg(target_arch = "x86_64")]
unsafe impl StableLayout for x86_64::__m256 {}
#[cfg(target_arch = "x86_64")]
unsafe impl StableLayout for x86_64::__m256d {}