Skip to content

Commit 8f9ca24

Browse files
committed
expand -Z flag docs
1 parent 86aa835 commit 8f9ca24

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,17 @@ which should be the toolchain specified in the `rust-version` file.
9898

9999
## Miri `-Z` flags
100100

101-
Miri adds some extra `-Z` flags to control its behavior:
102-
103-
* `-Zmiri-start-fn`: This makes interpretation start with `lang_start` (defined
104-
in libstd) instead of starting with `main`. Requires full MIR!
105-
* `-Zmiri-disable-validation` disables enforcing the validity invariant.
101+
Several `-Z` flags are relevant for miri:
102+
103+
* `-Zmir-opt-level` controls how many MIR optimizations are performed. miri
104+
overrides the default to be `0`; be advised that using any higher level can
105+
make miri miss bugs in your program because they got optimized away.
106+
* `-Zalways-encode-mir` makes rustc dump MIR even for completely monomorphic
107+
functions. This is needed so that miri can execute such functions, so miri
108+
sets this flag per default.
109+
* `-Zmiri-disable-validation` is a custom `-Z` flag added by miri. It disables
110+
enforcing the validity invariant, which is enforced by default. This is
111+
mostly useful for debugging; it means miri will miss bugs in your program.
106112

107113
## Development and Debugging
108114

0 commit comments

Comments
 (0)