Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out wasm32_unknown_unknown_js feature #2130

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ std = ["alloc"]
unstable-testing-arm-no-hw = []
unstable-testing-arm-no-neon = []
test_logging = []
wasm32_unknown_unknown_js = ["getrandom/js"]
wasm32_unknown_unknown_js = ["getrandom/js", "wasm32_unknown_unknown"]
wasm32_unknown_unknown = []

# XXX: debug = false because of https://github.com/rust-lang/rust/issues/34122

Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
//! require an operating environment of some kind. This has no effect
//! for any other target. This enables the `getrandom` crate's `js`
//! feature.
//! <tr><td><code>wasm32_unknown_unknown</code>
//! <td>When this feature is enabled, for the wasm32-unknown-unknown target,
//! `getrandom` is used and assumed to be preconfigured in a WASM
//! environment. This has no effect for any other target.
//! </table>

// When running mk/package.sh, don't actually build any code.
Expand Down
2 changes: 1 addition & 1 deletion src/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,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")
)
),
))]
Expand Down