Skip to content

Commit d7bcaab

Browse files
committed
document -Zmiri-seed
1 parent ff88062 commit d7bcaab

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,23 @@ MIRI_SYSROOT=$(rustc +custom --print sysroot) cargo +custom run --manifest-path
231231

232232
Several `-Z` flags are relevant for Miri:
233233

234-
* `-Zmir-opt-level` controls how many MIR optimizations are performed. miri
234+
* `-Zmiri-seed=<hex>` is a custom `-Z` flag added by Miri. It enables the
235+
interpreted program to seed an RNG with system entropy. Miri will keep an RNG
236+
on its own that is seeded with the given seed, and use that to generate the
237+
"system entropy" that seeds the RNG(s) in the interpreted program.
238+
**NOTE**: This entropy is not good enough for cryptographic use! Do not
239+
generate secret keys in Miri or perform other kinds of cryptographic
240+
operations that rely on proper random numbers.
241+
* `-Zmiri-disable-validation` disables enforcing the validity invariant, which
242+
is enforced by default. This is mostly useful for debugging; it means Miri
243+
will miss bugs in your program. However, this can also help to make Miri run
244+
faster.
245+
* `-Zmir-opt-level` controls how many MIR optimizations are performed. Miri
235246
overrides the default to be `0`; be advised that using any higher level can
236-
make miri miss bugs in your program because they got optimized away.
247+
make Miri miss bugs in your program because they got optimized away.
237248
* `-Zalways-encode-mir` makes rustc dump MIR even for completely monomorphic
238-
functions. This is needed so that miri can execute such functions, so miri
249+
functions. This is needed so that Miri can execute such functions, so Miri
239250
sets this flag per default.
240-
* `-Zmiri-disable-validation` is a custom `-Z` flag added by miri. It disables
241-
enforcing the validity invariant, which is enforced by default. This is
242-
mostly useful for debugging; it means miri will miss bugs in your program.
243251

244252
Moreover, Miri recognizes some environment variables:
245253

0 commit comments

Comments
 (0)