1Invalid monomorphization of an intrinsic function was used.23Erroneous code example:45```compile_fail,E05116#![feature(intrinsics)]78#[rustc_intrinsic]9unsafe fn simd_add<T>(a: T, b: T) -> T;1011fn main() {12 unsafe { simd_add(0, 1); }13 // error: invalid monomorphization of `simd_add` intrinsic14}15```1617The generic type has to be a SIMD type. Example:1819```20#![feature(repr_simd)]21#![feature(intrinsics)]2223#[repr(simd)]24#[derive(Copy, Clone)]25struct i32x2([i32; 2]);2627#[rustc_intrinsic]28unsafe fn simd_add<T>(a: T, b: T) -> T;2930unsafe { simd_add(i32x2([0, 0]), i32x2([1, 2])); } // ok!31```
Findings
✓ No findings reported for this file.