Closed
Description
The load
function is documented as follows:
portable-simd/crates/core_simd/src/vector.rs
Lines 191 to 197 in 8d9bcda
In particular, the last part says that there are no alignment restrictions on the pointer. However, the implementation performs a copy_nonoverlapping
at type [T; N]
, which means that ptr
actually must be T
-aligned. This is unsound under the stated precondition for this function. (There don't seem to be tests actually using this with unaligned pointers, so Miri can't catch this.)
It is unclear to me what the intended behavior is, though I would have expected that alignment is indeed required -- i.e., I would guess the docs are wrong and the code is right.