const_format/
for_assert_macros.rs

1#![allow(non_fmt_panics)]
2
3use crate::pargument::PArgument;
4
5#[track_caller]
6pub const fn assert_(cond: bool, message: &'static str) {
7    if cond {
8        panic!("{}", message)
9    }
10}
11
12// The `T` type parameter is there just so that the PARGUMENTS associated constant
13// is evaluated lazily.
14pub trait ConcatArgsIf<T, const COND: bool> {
15    const PARGUMENTS: &'static [PArgument];
16}
17
18impl<S, T> ConcatArgsIf<T, false> for S {
19    const PARGUMENTS: &'static [PArgument] = &[];
20}