diff options
| author | bors <bors@rust-lang.org> | 2025-07-21 02:31:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-21 02:31:56 +0000 |
| commit | e05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa (patch) | |
| tree | cfa5e765a3479a007839b9ced139ff8199f56ad6 /tests/ui/simd/intrinsic/generic-cast-pointer-width.rs | |
| parent | 460259d14de0274b97b8801e08cb2fe5f16fdac5 (diff) | |
| parent | 41ce1ed252f194756fb2f3e3e92bbdfb3940088d (diff) | |
| download | rust-e05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa.tar.gz rust-e05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa.zip | |
Auto merge of #143833 - scottmcm:final-mcp-838, r=compiler-errors
Ban projecting into SIMD types [MCP838] Closes https://github.com/rust-lang/compiler-team/issues/838 The actual compiler change here is tiny; there's just a bazillion tests to update. ~~Since I'm sure I've missed some, for now~~ ~~r ghost~~ try-job: test-various try-job: x86_64-gnu-nopt
Diffstat (limited to 'tests/ui/simd/intrinsic/generic-cast-pointer-width.rs')
| -rw-r--r-- | tests/ui/simd/intrinsic/generic-cast-pointer-width.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs index ea34e9ffeb8..594d1d25d16 100644 --- a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs +++ b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs @@ -1,18 +1,24 @@ //@ run-pass #![feature(repr_simd, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_cast; -#[derive(Copy, Clone)] -#[repr(simd)] -struct V<T>([T; 4]); +type V<T> = Simd<T, 4>; fn main() { - let u = V::<usize>([0, 1, 2, 3]); + let u: V::<usize> = Simd([0, 1, 2, 3]); let uu32: V<u32> = unsafe { simd_cast(u) }; let ui64: V<i64> = unsafe { simd_cast(u) }; - for (u, (uu32, ui64)) in u.0.iter().zip(uu32.0.iter().zip(ui64.0.iter())) { + for (u, (uu32, ui64)) in u + .as_array() + .iter() + .zip(uu32.as_array().iter().zip(ui64.as_array().iter())) + { assert_eq!(*u as u32, *uu32); assert_eq!(*u as i64, *ui64); } |
