#[cfg_attr(feature = "nightly", doc = "```ignore")]
#[cfg_attr(not(feature = "nightly"), doc = "```")]
#[cfg_attr(feature = "nightly", doc = "```")]
#[cfg_attr(not(feature = "nightly"), doc = "```ignore")]
#[macro_export(local_inner_macros)]
macro_rules! const_assert {
($($xs:tt)+) => { _const_assert!($($xs)+); };
}
#[doc(hidden)]
#[cfg(feature = "nightly")]
#[macro_export(local_inner_macros)]
#[allow(dead_code)]
macro_rules! _const_assert {
($($xs:expr),+ $(,)*) => {
#[allow(unknown_lints, eq_op)]
const _: [(); 0 - !($($xs)&&+) as usize] = [];
};
}
#[doc(hidden)]
#[cfg(not(feature = "nightly"))]
#[macro_export(local_inner_macros)]
macro_rules! _const_assert {
($($xs:expr),+ $(,)*) => {
#[allow(unknown_lints, eq_op)]
let _ = [(); 0 - !($($xs)&&+) as usize];
};
($label:ident; $($xs:tt)+) => {
#[allow(dead_code, non_snake_case)]
fn $label() { const_assert!($($xs)+); }
};
}
#[cfg_attr(feature = "nightly", doc = "```ignore")]
#[cfg_attr(not(feature = "nightly"), doc = "```")]
#[macro_export(local_inner_macros)]
macro_rules! const_assert_eq {
($x:expr, $($xs:expr),+ $(,)*) => {
const_assert!($($x == $xs),+);
};
($label:ident; $x:expr, $($xs:expr),+ $(,)*) => {
const_assert!($label; $($x == $xs),+);
};
}