File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,14 @@ of randomness based on their specific needs:
8686| ` custom ` | All targets | ` * ` | User-provided custom implementation (see [ custom backend] )
8787
8888Opt-in backends can be enabled using the ` getrandom_backend ` configuration flag.
89- The flag can be set either by specifying the ` rustflags ` field in
90- [ ` .cargo/config.toml ` ] (note that it can be done on a per-target basis), or by using
91- the ` RUSTFLAGS ` environment variable:
89+ The flag can be set either by specifying the ` rustflags ` field in [ ` .cargo/config.toml ` ] :
90+ ``` toml
91+ # It's recommended to set the flag on a per-target basis:
92+ [target .wasm32-unknown-unknown ]
93+ rustflags = [' --cfg' , ' getrandom_backend="wasm_js"' ]
94+ ```
95+
96+ Or by using the ` RUSTFLAGS ` environment variable:
9297
9398``` sh
9499RUSTFLAGS=' --cfg getrandom_backend="linux_getrandom"' cargo build
You can’t perform that action at this time.
0 commit comments