#[ cfg( feature = "diagnostics_compiletime_assertions" ) ]
pub( crate ) mod private
{
#[ macro_export ]
macro_rules! cta_type_same_size
{
( $Type1:ty, $Type2:ty $(,)? ) =>
{{
const _ : fn() = ||
{
let _ : [ () ; core::mem::size_of::< $Type1 >() ] = [ () ; core::mem::size_of::< $Type2 >() ];
};
true
}}
}
#[ macro_export ]
macro_rules! cta_type_same_align
{
( $Type1:ty, $Type2:ty $(,)? ) =>
{{
const _ : fn() = ||
{
let _ : [ () ; core::mem::align_of::< $Type1 >() ] = [ () ; core::mem::align_of::< $Type2 >() ];
};
true
}};
}
#[ macro_export ]
macro_rules! cta_ptr_same_size
{
( $Ins1:expr, $Ins2:expr $(,)? ) =>
{{
#[ allow( unsafe_code, unknown_lints, forget_copy, useless_transmute ) ]
let _ = || unsafe
{
let mut ins1 = core::ptr::read( $Ins1 );
core::ptr::write( &mut ins1, core::mem::transmute( core::ptr::read( $Ins2 ) ) );
core::mem::forget( ins1 );
};
true
}}
}
#[ macro_export ]
macro_rules! cta_mem_same_size
{
( $Ins1:expr, $Ins2:expr $(,)? ) =>
{{
$crate::cta_ptr_same_size!( &$Ins1, &$Ins2 )
}}
}
pub use cta_type_same_size;
pub use cta_type_same_align;
pub use cta_ptr_same_size;
pub use cta_mem_same_size;
}
pub mod protected
{
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use super::orphan::*;
}
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use protected::*;
pub mod orphan
{
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use super::exposed::*;
}
pub mod exposed
{
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use super::prelude::*;
}
pub mod prelude
{
#[ cfg( feature = "diagnostics_compiletime_assertions" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use super::private::
{
cta_type_same_size,
cta_type_same_align,
cta_ptr_same_size,
cta_mem_same_size,
};
}