macro_rules! const_assert_ne { ($x:expr, $y:expr $(,)?) => { ... }; }
Asserts that constants are not equal in value.
This works as a shorthand for const_assert!(a != b):
const_assert!(a != b)
const NUM: usize = 32; const_assert_ne!(NUM * NUM, 64);
The following example fails to compile because 2 is magic and 2 × 2 = 2 + 2:
const_assert_ne!(2 + 2, 2 * 2);