Skip to content

Commit

Permalink
Add workaround for rust-lang/rust#80108
Browse files Browse the repository at this point in the history
  • Loading branch information
calebzulawski committed Dec 17, 2020
1 parent 9b8cb18 commit 5994771
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion crates/core_simd/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,23 @@ macro_rules! impl_vector {

/// Converts a SIMD vector to an array.
pub const fn to_array(self) -> [$type; LANES] {
self.0
// workaround for rust-lang/rust#80108
// TODO fix this
#[cfg(target_arch = "wasm32")]
{
let mut arr = [self.0[0]; LANES];
let mut i = 0;
while i < LANES {
arr[i] = self.0[i];
i += 1;
}
arr
}

#[cfg(not(target_arch = "wasm32"))]
{
self.0
}
}
}

Expand Down

0 comments on commit 5994771

Please sign in to comment.