Closed
Description
For some reason this only occurs with wasm. If you compile this on the playground, it works just fine until you compile for wasm, which produces this error.
Code
#![feature(repr_simd)]
#[repr(simd)]
pub struct Vector([i32; 4]);
impl Vector {
pub const fn to_array(self) -> [i32; 4] {
self.0
}
}
Meta
rustc --version --verbose
:
rustc 1.50.0-nightly (b32e6e6ac 2020-12-16)
binary: rustc
commit-hash: b32e6e6ac8921035177256ab6806e6ab0d4b9b94
commit-date: 2020-12-16
host: x86_64-apple-darwin
release: 1.50.0-nightly
Error output
Invalid bitcast
%4 = bitcast <4 x i32> %1 to [4 x i32], !dbg !21
in function _ZN10playground6Vector8to_array17h22d416c39ac2333dE
LLVM ERROR: Broken function found, compilation aborted!
Metadata
Metadata
Assignees
Labels
Area: SIMD (Single Instruction Multiple Data)Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Target: WASM (WebAssembly), http://webassembly.org/Relevant to the compiler team, which will review and decide on the PR/issue.