Macro code_spells::unforgivable
source · macro_rules! unforgivable { ($($code:tt)+) => { ... }; }
Expand description
Alias for unsafe. What could be more unforgivable than undefined behaviour?
Example
use core::num::NonZeroU8;
// Forgivability: `new_unchecked` is UB if the argument is zero, but two is not zero.
const two: NonZeroU8 = unforgivable! { NonZeroU8::new_unchecked(2) };
assert_eq!(two.get(), 2);