Skip to contentSkip to conversation

rust: static_assert: add optional message

PATCH Benno Lossin 1 participant 1 message Mar 27, 2025 Rust

lore
Share & tools
lore

Benno Lossin

author Reviewed-by
#0 lore raw
Quoted 8 lines · Altan Ozlu

Add an optional panic message to the static_assert! macro.

The panic message doesn't support argument formatting, because the assert! macro only supports formatting in non-const contexts.

---
Cheers,
Benno

Quoted 5 lines

---
Link to v3: https://lore.kernel.org/rust-for-linux/[email protected]/

---
 rust/kernel/static_assert.rs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)