#![allow(dead_code)]
use static_assert_generic::*;
const FOO: () = static_assert!(() 1 + 1 == 2);
#[allow(clippy::assertions_on_constants, clippy::eq_op)] const BAR: () = assert!(1 + 1 == 2);
#[test]
fn test() {
static_assert!(() 1 + 2 < 17);
fn foo<const N: usize>() {
static_assert!((N: usize) N != 0 => "N must be a non-zero value!");
}
fn baz<const N: usize, const M: usize>() {
static_assert!((N: usize, M: usize) N > M => "N must be greater than M!");
}
fn spam<T>() {
static_assert!((T) std::mem::size_of::<T>() == 4 => "T must be 4 bytes long!");
}
fn eggs<U: ?Sized>() {
static_assert!((U?) true => "There isn't much you can statically check about unsized types.");
}
fn fie<const N: usize, const M: usize, T>() {
static_assert!((N: usize, M: usize) N > M => "N must be greater than M!");
static_assert!((N: usize, T) N == std::mem::size_of::<T>() / 2 => "N must be half the size of T!");
}
}