Skip to content

Commit

Permalink
README: add note regarding wasm32-unknown-unknown
Browse files Browse the repository at this point in the history
Addresses #1110 and #1131.
  • Loading branch information
dhardy committed May 31, 2021
1 parent 2732f2d commit d9c6a76
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ unavailable (unless `getrandom` is enabled), large parts of `seq` are
unavailable (unless `alloc` is enabled), and `thread_rng` and `random` are
unavailable.

### WASM support

The WASM target `wasm32-unknown-unknown` is not *automatically* supported by
`rand` or `getrandom`. To solve this, either use a different target such as
`wasm32-wasi` or add a direct dependancy on `getrandom` with the `js` feature
(if the target supports JavaScript). See
[getrandom#WebAssembly support](https://docs.rs/getrandom/latest/getrandom/#webassembly-support).

# License

Rand is distributed under the terms of both the MIT license and the
Expand Down

0 comments on commit d9c6a76

Please sign in to comment.