Skip to content

Commit 500071e

Browse files
authored
Prevent parallel wasm builds
Attempting to target wasm with the parallel feature on fails because `rayon` does not natively support it. Parallelism on WebAssembly is technically achievable through the Web Workers API, but until such functionality is stable, this should provide a better error message.
1 parent 1381624 commit 500071e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ extern crate num_traits as num;
3131
// #[macro_use]
3232
// extern crate array_macro;
3333

34+
#[cfg(all(target_family = "wasm", feature = "parallel"))]
35+
std::compile_error!("Rapier does not currently support parallelism on WebAssembly.")
36+
3437
#[cfg(feature = "parallel")]
3538
pub use rayon;
3639

0 commit comments

Comments
 (0)