//@ build-fail // Test that the simd_shuffle intrinsic produces ok-ish error // messages when misused. #![feature(repr_simd, intrinsics)] #[repr(simd)] #[derive(Copy, Clone)] pub struct Simd([T; N]); extern "rust-intrinsic" { fn simd_shuffle(a: T, b: T, i: I) -> U; } fn main() { const I: Simd = Simd([0; 2]); const I2: Simd = Simd([0.; 2]); let v = Simd::([0; 4]); unsafe { let _: Simd = simd_shuffle(v, v, I); let _: Simd = simd_shuffle(v, v, const { [0u32; 2] }); //~^ ERROR invalid monomorphization of `simd_shuffle` intrinsic let _: Simd = simd_shuffle(v, v, I); //~^ ERROR invalid monomorphization of `simd_shuffle` intrinsic let _: Simd = simd_shuffle(v, v, I); //~^ ERROR invalid monomorphization of `simd_shuffle` intrinsic let _: Simd = simd_shuffle(v, v, I2); //~^ ERROR invalid monomorphization of `simd_shuffle` intrinsic } }