use debug_assert_** with not(feature = "strict_asserts")
strict_asserts should at least validate with the debug_assert_** family of macros in debug builds. Otherwise undefined behavior can sneak by.
@@ -35,15 +35,21 @@ macro_rules! strict_assert_ne {
#[cfg(not(feature = "strict_asserts"))]
#[macro_export]
macro_rules! strict_assert {
- ( $( $arg:tt )* ) => {};
+ ( $( $arg:tt )* ) => {
+ debug_assert!( $( $arg )* )
+ };
}
#[cfg(not(feature = "strict_asserts"))]
macro_rules! strict_assert_eq {
- ( $( $arg:tt )* ) => {};
+ ( $( $arg:tt )* ) => {
+ debug_assert_eq!( $( $arg )* )
+ };
}
#[cfg(not(feature = "strict_asserts"))]
macro_rules! strict_assert_ne {
- ( $( $arg:tt )* ) => {};
+ ( $( $arg:tt )* ) => {
+ debug_assert_ne!( $( $arg )* )
+ };
}
