Skip to main content

panic_ub/
lib.rs

1#![no_std]
2#[cfg(feature = "enabled")]
3const _: () = {
4    use core::{hint::unreachable_unchecked, panic::PanicInfo};
5
6    #[cfg(any(not(debug_assertions), feature = "force"))]
7    const _: () = {
8        #[cfg(not(test))]
9        const _: () = {
10            #[panic_handler]
11            fn panic(info: &PanicInfo) -> ! {
12                unsafe { unreachable_unchecked() }
13            }
14        };
15    };
16};