macro_rules! const_assert {
($cond:expr $(,)?) => { ... };
($cond:expr, $($arg:tt)+) => { ... };
}
Expand description
Asserts that a boolean expression is true
at compile-time.
Rust provides const
blocks, which can be used flexibly within methods, but cannot be used
directly at the top level. This macro serves as a helper to perform compile-time assertions
outside of methods.