Skip to content
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
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ exclude = [".*"]
# use std to retrieve OS error descriptions
std = []

# Use the custom backend on unsupported targets
Copy link
Member

@dhardy dhardy Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say:

# Use the custom backend when getrandom_backend cfg is not set

# WARNING: this feature SHOULD be enabled only by fallback implementation crates!
custom-fallback = []

# Optional backend: wasm_js
# This flag enables the backend but does not select it. To use the backend, use
# this flag *and* set getrandom_backend=wasm_js (see README).
Expand Down
3 changes: 3 additions & 0 deletions src/backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ cfg_if! {
} else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] {
mod rdrand;
pub use rdrand::*;
} else if #[cfg(feature = "custom-fallback")] {
mod custom;
pub use custom::*;
} else if #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] {
compile_error!(concat!(
"The wasm32-unknown-unknown targets are not supported by default; \
Expand Down
Loading