extern crate zerocopy;
#[allow(unused)]
#[cfg(feature = "derive")]
mod util {
pub struct NotZerocopy<T = ()>(pub T);
#[derive(
zerocopy::KnownLayout,
zerocopy::Immutable,
zerocopy::FromBytes,
zerocopy::IntoBytes,
Copy,
Clone,
)]
#[repr(C, align(2))]
pub struct AU16(pub u16);
#[macro_export]
macro_rules! util_assert_impl_all {
($type:ty: $($trait:path),+ $(,)?) => {
const _: fn() = || {
use ::core::prelude::v1::*;
::static_assertions::assert_impl_all!($type: $($trait),+);
};
};
}
#[macro_export]
macro_rules! util_assert_not_impl_any {
($x:ty: $($t:path),+ $(,)?) => {
const _: fn() = || {
use ::core::prelude::v1::*;
::static_assertions::assert_not_impl_any!($x: $($t),+);
};
};
}
#[macro_export]
macro_rules! test_trivial_is_bit_valid {
($x:ty => $name:ident) => {
#[test]
fn $name() {
util::test_trivial_is_bit_valid::<$x>();
}
};
}
}