#[doc(hidden)]
#[macro_export]
macro_rules! cfg_if_safemode {
[ #if_safe() { $($all:tt)* } $( else $($else_all:tt)* )? ] => {
{
#[cfg(
any(
feature = "always_safe_manuallydrop",
all(feature = "always_check_in_case_debug_assertions", debug_assertions),
)
)] {
$($all)*
}
$(
#[cfg(not(
any(
feature = "always_safe_manuallydrop",
all(feature = "always_check_in_case_debug_assertions", debug_assertions),
)
))] {
$($else_all)*
}
)?
}
};
[
$(#[$($meta:tt)*])*
#if_safe ( $($all:tt)* ) $($macros_data:tt)*
] => {
#[cfg(
any(
feature = "always_safe_manuallydrop",
all(feature = "always_check_in_case_debug_assertions", debug_assertions),
)
)]
$(#[$($meta)*])*
$($all)*
$crate::cfg_if_safemode! {
$($macros_data)*
}
};
[
$(#[$($meta:tt)*])*
#if_not_safe ( $($all:tt)* ) $($macros_data:tt)*
] => {
#[cfg(
not(
any(
feature = "always_safe_manuallydrop",
all(feature = "always_check_in_case_debug_assertions", debug_assertions),
)
)
)]
$(#[$($meta)*])*
$($all)*
$crate::cfg_if_safemode! {
$($macros_data)*
}
};
[] => {};
[ #if_safe { $($all:tt)* } ] => {
{
#[cfg(
any(
feature = "always_safe_manuallydrop",
all(feature = "always_check_in_case_debug_assertions", debug_assertions)
)
)] {
$($all)*
}
}
};
}
cfg_if_safemode! {
#if_not_safe(pub type AutoSafeManuallyDrop<T, Trig> = crate::beh::r#unsafe::UnsafeManuallyDrop<T, Trig>;)
#if_safe(pub type AutoSafeManuallyDrop<T, Trig> = crate::beh::safe::SafeManuallyDrop<T, Trig>;)
}