1 // Auxiliary crate used for testing post-monomorphization errors cross-crate.
2 // It duplicates the setup used in `stdarch` to validate its intrinsics' const arguments.
4 struct ValidateConstImm<const IMM: i32, const MIN: i32, const MAX: i32>;
5 impl<const IMM: i32, const MIN: i32, const MAX: i32> ValidateConstImm<IMM, MIN, MAX> {
6 pub(crate) const VALID: () = {
7 let _ = 1 / ((IMM >= MIN && IMM <= MAX) as usize);
11 macro_rules! static_assert_imm1 {
13 let _ = $crate::ValidateConstImm::<$imm, 0, { (1 << 1) - 1 }>::VALID;
17 // This function triggers an error whenever the const argument does not fit in 1-bit.
18 pub fn stdarch_intrinsic<const IMM1: i32>() {
19 static_assert_imm1!(IMM1);