Open
Description
Currently, repr(C, simd)
warns about "incompatible representation hints", but leaving off the repr(C)
triggers the FFI lint when the SIMD type is used in FFI.
Note that #[repr(C)] #[repr(simd)]
does not warn only due to #47094. Most uses of SIMD in FFI this in the Rust source tree use two separate repr attributes, which is why they didn't trigger this warning so far.
There's two ways to resolve this:
- Require
repr(C, simd)
for SIMD types used in FFI. - Say
repr(simd)
is sufficient for FFI (in principle -- there are other concerns that keep SIMD-FFI feature gated at the moment) and keep the warning aboutrepr(C, simd)
. It could optionally restricted to some simd types that are known to correspond to C types on the platform in question (e.g., permitf32x4
but notf32x3
).