-
Notifications
You must be signed in to change notification settings - Fork 241
Remove all uses of getrandom_backend = "wasm_js"
#771
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
base: master
Are you sure you want to change the base?
Changes from all commits
34b0177
84c8cdf
0a2e230
97df661
a9dbad7
03f3478
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,10 +20,16 @@ features = ["std", "sys_rng"] | |
| std = [] | ||
|
|
||
| # Optional backend: wasm_js | ||
| # | ||
| # This flag enables the wasm_js backend and uses it by default on wasm32 where | ||
| # the target_os is unknown. The getrandom_backend cfg may override this. | ||
| # WARNING: It is highly recommended to enable this feature only for binary crates and tests, | ||
| # i.e. avoid unconditionally enabling it in library crates. | ||
| # | ||
| # WARNING: This feature SHOULD be enabled ONLY for binary crates and tests. In other words, | ||
| # avoid enabling it in library crates whether unconditionally or gated on a crate feature. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I see no hard reason not to have a "forwarding" feature flag (e.g. I know you don't like this pattern, but I don't think directing users like this will work particularly well. I suggest we keep our advice direct and minimally opinionated:
|
||
| # By not following this recommendation you may break builds for users targeting non-Web WASM. | ||
| # | ||
| # The only exception to this rule: if your crate already unconditionally depends on `wasm-bindgen` | ||
| # or `js-sys` on "unknown" WASM targets then it's acceptable to enable this feature unconditionally. | ||
| wasm_js = ["dep:wasm-bindgen", "dep:js-sys"] | ||
|
|
||
| # Provide SysRng over rand_core | ||
|
|
@@ -84,7 +90,7 @@ wasm-bindgen-test = "0.3" | |
| [lints.rust.unexpected_cfgs] | ||
| level = "warn" | ||
| check-cfg = [ | ||
| 'cfg(getrandom_backend, values("custom", "efi_rng", "rdrand", "rndr", "linux_getrandom", "linux_raw", "wasm_js", "windows_legacy", "unsupported"))', | ||
| 'cfg(getrandom_backend, values("custom", "efi_rng", "rdrand", "rndr", "linux_getrandom", "linux_raw", "windows_legacy", "unsupported"))', | ||
| 'cfg(getrandom_msan)', | ||
| 'cfg(getrandom_test_linux_fallback)', | ||
| 'cfg(getrandom_test_linux_without_fallback)', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still want
-Dwarnings(unless substituted below)