1
0
Fork 0
firefox/third_party/rust/bindgen/extra_assertions.rs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

17 lines
570 B
Rust

//! Macros for defining extra assertions that should only be checked in testing
//! and/or CI when the `__testing_only_extra_assertions` feature is enabled.
/// Simple macro that forwards to assert! when using
/// __testing_only_extra_assertions.
macro_rules! extra_assert {
( $cond:expr ) => {
if cfg!(feature = "__testing_only_extra_assertions") {
assert!($cond);
}
};
( $cond:expr , $( $arg:tt )+ ) => {
if cfg!(feature = "__testing_only_extra_assertions") {
assert!($cond, $( $arg )* )
}
};
}