use core::fmt::Arguments;
use crate::core::trig::TrigManuallyDrop;
#[cfg(feature = "support_istrig_loop")]
mod _support_istrig_loop {
use core::sync::atomic::Ordering;
use core::sync::atomic::AtomicBool;
pub static IS_TRIG_LOOPSAFEMANUALLYDROP: AtomicBool = AtomicBool::new(false);
pub const DEF_SETORDERING: Ordering = Ordering::SeqCst;
pub const DEF_GETORDERING: Ordering = Ordering::Relaxed;
}
pub type AlwaysSafeEmptyLoopManuallyDrop<T> = crate::beh::safe::SafeManuallyDrop<T, EmptyLoopTrigManuallyDrop>;
pub type AutoSafeEmptyLoopManuallyDrop<T> = crate::beh::auto::AutoSafeManuallyDrop<T, EmptyLoopTrigManuallyDrop>;
pub enum EmptyLoopTrigManuallyDrop {}
impl TrigManuallyDrop for EmptyLoopTrigManuallyDrop {
#[inline]
fn trig_next_invalid_beh<'a>(_a: Arguments<'a>) -> trig_manuallydrop_returntype!() {
#[cfg(feature = "support_istrig_loop")] {
unsafe {
crate::core::trig::r#loop::trig_next_invalid_beh()
}
}
loop {}
}
}
#[cfg(feature = "support_istrig_loop")]
#[inline]
pub unsafe fn trig_next_invalid_beh() {
_support_istrig_loop::IS_TRIG_LOOPSAFEMANUALLYDROP.store(
true,
_support_istrig_loop::DEF_SETORDERING
);
}
#[cfg(not(feature = "support_istrig_loop"))]
#[inline]
pub const unsafe fn trig_next_invalid_beh() {}
#[cfg(feature = "support_istrig_loop")]
#[inline]
pub fn is_trig_next_invalid_beh() -> bool {
_support_istrig_loop::IS_TRIG_LOOPSAFEMANUALLYDROP.load(
_support_istrig_loop::DEF_GETORDERING
)
}
#[cfg(not(feature = "support_istrig_loop"))]
#[inline]
pub const fn is_trig_next_invalid_beh() -> bool {
false
}
impl AutoSafeEmptyLoopManuallyDrop<()> {
#[inline(always)]
pub fn is_trig_next_invalid_beh() -> bool {
crate::core::trig::r#loop::is_trig_next_invalid_beh()
}
}