Macro static_assertions::const_assert
[−]
[src]
macro_rules! const_assert { ($($xs:expr),+) => { ... }; ($label:ident; $($xs:expr),+) => { ... }; }
Asserts at compile-time that the constant expression evaluates to true
.
Example
const_assert!(2 + 2 == 4); const FIVE: usize = 5; const_assert!(FIVE - FIVE == 0); // Produces a compilation failure: // const_assert!(1 >= 2);