macro_rules! const_assert_eq { ($x:expr, $y:expr $(,)?) => { ... }; }
Asserts that constants are equal in value.
This works as a shorthand for const_assert!(a == b):
const_assert!(a == b)
const TWO: usize = 2; const_assert_eq!(TWO * TWO, TWO + TWO);
Just because 2 × 2 = 2 + 2 doesn’t mean it holds true for other numbers:
const_assert_eq!(4 + 4, 4 * 4);