diff --git a/Cargo.toml b/Cargo.toml
index 494b708a8..66e96071a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -195,7 +195,9 @@ std = ["alloc"]
unstable-testing-arm-no-hw = []
unstable-testing-arm-no-neon = []
test_logging = []
-wasm32_unknown_unknown_js = ["getrandom/js"]
+wasm32_unknown_unknown_custom_or_js = []
+wasm32_unknown_unknown_custom = ["wasm32_unknown_unknown_custom_or_js", "getrandom/custom"]
+wasm32_unknown_unknown_js = ["wasm32_unknown_unknown_custom_or_js", "getrandom/js"]
# XXX: debug = false because of https://github.com/rust-lang/rust/issues/34122
diff --git a/src/lib.rs b/src/lib.rs
index 830b0898c..e38428a4a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -43,12 +43,17 @@
//!
std
//! | Enable features that use libstd, in particular
//! std::error::Error integration. Implies `alloc`.
-//! |
wasm32_unknown_unknown_js
+//! |
wasm32_unknown_unknown_custom_or_js
//! | When this feature is enabled, for the wasm32-unknown-unknown target,
//! Web APIs will be used to implement features like `ring::rand` that
//! require an operating environment of some kind. This has no effect
-//! for any other target. This enables the `getrandom` crate's `js`
-//! feature.
+//! for any other target.
+//! |
wasm32_unknown_unknown_js
+//! | Enable both `wasm32_unknown_unknown_custom_or_js` and the `getrandom`
+//! crate's `js` feature.
+//! |
wasm32_unknown_unknown_custom
+//! | Enable both `wasm32_unknown_unknown_custom_or_js` and the `getrandom`
+//! crate's `custom` feature.
//!
// When running mk/package.sh, don't actually build any code.
diff --git a/src/rand.rs b/src/rand.rs
index 8a67117bc..23888aba7 100644
--- a/src/rand.rs
+++ b/src/rand.rs
@@ -154,7 +154,7 @@ impl crate::sealed::Sealed for SystemRandom {}
target_arch = "wasm32",
any(
target_os = "wasi",
- all(target_os = "unknown", feature = "wasm32_unknown_unknown_js")
+ all(target_os = "unknown", feature = "wasm32_unknown_unknown_custom_or_js")
)
),
))]
|