Skip to content

Commit

Permalink
Prevent parallel wasm builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bugQ authored Mar 11, 2023
1 parent 1381624 commit 500071e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ extern crate num_traits as num;
// #[macro_use]
// extern crate array_macro;

#[cfg(all(target_family = "wasm", feature = "parallel"))]
std::compile_error!("Rapier does not currently support parallelism on WebAssembly.")

#[cfg(feature = "parallel")]
pub use rayon;

Expand Down

0 comments on commit 500071e

Please sign in to comment.