File tree 1 file changed +8
-3
lines changed
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:
86
86
| ` custom ` | All targets | ` * ` | User-provided custom implementation (see [ custom backend] )
87
87
88
88
Opt-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:
92
97
93
98
``` sh
94
99
RUSTFLAGS=' --cfg getrandom_backend="linux_getrandom"' cargo build
You can’t perform that action at this time.
0 commit comments