Open
Description
I tried this code:
#![feature(repr_simd)]
use std::mem::transmute;
#[derive(Clone, Debug)]
#[repr(simd)]
struct CustomSimd<T, const LANES: usize>([T; LANES]);
fn main() {
let mut input : CustomSimd<u8, 10> = CustomSimd([0u8; 10]);
input.0[0] = u8::MAX;
let data = unsafe { transmute::<_, CustomSimd<u8, 10>>(input).0 };
assert_eq!(data, [u8::MAX, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
}
I expected to see this happen: I expected this test to succeed since the destination type is the same as the source type.
Instead, this happened: This test fails. When running it with valgrind, I get errors such as:
Conditional jump or move depends on uninitialised value(s)
Meta
I used the playground version:
Nightly channel
Build using the Nightly version: 1.72.0-nightly
(2023-07-06 85bf07972a1041b9e253)