diff --git a/Cargo.toml b/Cargo.toml index 56e8f48fd6..0cffa5a00f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -173,7 +173,7 @@ once_cell = { version = "1.8.0", default-features = false, features=["std"], opt [target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "illumos", target_os = "netbsd", target_os = "openbsd", target_os = "redox", target_os = "solaris"))'.dependencies] once_cell = { version = "1.8.0", default-features = false, features=["std"] } -[target.'cfg(all(target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown", target_env = ""))'.dependencies] +[target.'cfg(all(feature = "wasm32-unknown-unknown", target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown", target_env = ""))'.dependencies] web-sys = { version = "0.3.51", default-features = false, features = ["Crypto", "Window"], optional = true } [target.'cfg(target_os = "windows")'.dependencies] diff --git a/src/rand.rs b/src/rand.rs index bd8b98ae3c..0166a156e4 100644 --- a/src/rand.rs +++ b/src/rand.rs @@ -246,6 +246,21 @@ mod sysrand_chunk { } } +#[cfg(all( + not(feature = "wasm32_unknown_unknown_js"), + target_arch = "wasm32", + target_vendor = "unknown", + target_os = "unknown", + target_env = "", +))] +mod sysrand_chunk { + use crate::error; + + pub fn chunk(mut dest: &mut [u8]) -> Result { + unimplemented!() + } +} + #[cfg(windows)] mod sysrand_chunk { use crate::{error, polyfill};