Macro static_assertions::const_assert_ne [−][src]
macro_rules! const_assert_ne { ($x:expr, $($xs:expr),+ $(,)*) => { ... }; ($label:ident; $x:expr, $($xs:expr),+ $(,)*) => { ... }; }
Expand description
Asserts that constants are not equal in value.
Examples
Works as a shorthand for const_assert!(a != b)
:
const_assert_ne!(nums; 1, 2, 3, 4); fn main() { const NUM: usize = 32; const_assert_ne!(NUM * NUM, 64); }
The magic number 2, where 2 × 2 = 2 + 2:
ⓘ
const_assert_ne!(2 + 2, 2 * 2);