Skip to main content Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. Rust
  4. pw_assert
  5. debug_panic

debug_panic

Macro debug_panic 

Source
macro_rules! debug_panic {
    ($($arg:tt)*) => { ... };
}
Expand description

Panics unconditionally when debug_assertions are enabled

If debug_assertions are enabled, this behaves exactly like panic! (delegating to panic_backend!). If debug_assertions are disabled, this macro is a no-op.

debug_assertions can be enabled by setting this bazel label to True @pigweed//pw_assert/rust:debug_assertions.

§Examples

pw_assert::debug_panic!("This should never happen in debug mode.");