File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 59
59
//! This crate fully supports the
60
60
//! [`wasm32-wasi`](https://github.com/CraneStation/wasi) and
61
61
//! [`wasm32-unknown-emscripten`](https://www.hellorust.com/setup/emscripten/)
62
- //! targets. However, the `wasm32-unknown-unknown` target is not automatically
62
+ //! targets. However, the `wasm32-unknown-unknown` target (i.e. the target used
63
+ //! by `wasm-pack`) is not automatically
63
64
//! supported since, from the target name alone, we cannot deduce which
64
65
//! JavaScript interface is in use (or if JavaScript is available at all).
65
66
//!
@@ -209,6 +210,11 @@ cfg_if! {
209
210
#[ path = "js.rs" ] mod imp;
210
211
} else if #[ cfg( feature = "custom" ) ] {
211
212
use custom as imp;
213
+ } else if #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ] {
214
+ compile_error!( "the wasm32-unknown-unknown target is not supported by \
215
+ default, you may need to enable the \" js\" feature. \
216
+ For more information see: \
217
+ https://docs.rs/getrandom/#webassembly-support") ;
212
218
} else {
213
219
compile_error!( "target is not supported, for more information see: \
214
220
https://docs.rs/getrandom/#unsupported-targets") ;
You can’t perform that action at this time.
0 commit comments