mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 16:53:48 +00:00
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.
This commit is contained in:
parent
51b34c5b51
commit
085e41171f
@ -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 )* )
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user