mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 10:47:16 +00:00
18 lines
421 B
Rust
18 lines
421 B
Rust
//@ only-wasm32
|
|
//@ compile-flags: --crate-type=lib -Copt-level=2
|
|
//@ build-pass
|
|
#![feature(repr_simd)]
|
|
|
|
// Regression test for #80108
|
|
|
|
#[repr(simd)]
|
|
pub struct Vector([i32; 4]);
|
|
|
|
impl Vector {
|
|
pub const fn to_array(self) -> [i32; 4] {
|
|
// This used to just be `.0`, but that was banned in
|
|
// <https://github.com/rust-lang/compiler-team/issues/838>
|
|
unsafe { std::mem::transmute(self) }
|
|
}
|
|
}
|