@@ -83,11 +83,10 @@ Now you can run your project in Miri:
83
83
The first time you run Miri, it will perform some extra setup and install some
84
84
dependencies. It will ask you for confirmation before installing anything.
85
85
86
- You can pass arguments to Miri after the first ` -- ` , and pass arguments to the
87
- interpreted program or test suite after the second ` -- ` . For example, `cargo
88
- miri run -- -Zmiri-disable-stacked-borrows` runs the program without checking
89
- the aliasing of references. To filter the tests being run, use `cargo miri test
90
- -- -- filter`.
86
+ ` cargo miri run/test ` supports the exact same flags as ` cargo run/test ` . You
87
+ can pass arguments to Miri via ` MIRIFLAGS ` . For example,
88
+ ` MIRIFLAGS="-Zmiri-disable-stacked-borrows" cargo miri run ` runs the program
89
+ without checking the aliasing of references.
91
90
92
91
Miri supports cross-execution: if you want to run the program as if it was a
93
92
Linux program, you can do ` cargo miri run --target x86_64-unknown-linux-gnu ` .
@@ -163,7 +162,8 @@ up the sysroot. If you are using `miri` (the Miri driver) directly, see the
163
162
## Miri ` -Z ` flags and environment variables
164
163
[ miri-flags ] : #miri--z-flags-and-environment-variables
165
164
166
- Miri adds its own set of ` -Z ` flags:
165
+ Miri adds its own set of ` -Z ` flags, which are usually set via the ` MIRIFLAGS `
166
+ environment variable:
167
167
168
168
* ` -Zmiri-disable-alignment-check ` disables checking pointer alignment, so you
169
169
can focus on other failures, but it means Miri can miss bugs in your program.
@@ -229,14 +229,14 @@ Moreover, Miri recognizes some environment variables:
229
229
230
230
* ` MIRI_LOG ` , ` MIRI_BACKTRACE ` control logging and backtrace printing during
231
231
Miri executions, also [ see above] [ testing-miri ] .
232
+ * ` MIRIFLAGS ` (recognized by ` cargo miri ` and the test suite) defines extra
233
+ flags to be passed to Miri.
232
234
* ` MIRI_SYSROOT ` (recognized by ` cargo miri ` and the test suite)
233
235
indicates the sysroot to use. To do the same thing with ` miri `
234
236
directly, use the ` --sysroot ` flag.
235
237
* ` MIRI_TEST_TARGET ` (recognized by the test suite) indicates which target
236
238
architecture to test against. ` miri ` and ` cargo miri ` accept the ` --target `
237
239
flag for the same purpose.
238
- * ` MIRI_TEST_FLAGS ` (recognized by the test suite) defines extra flags to be
239
- passed to Miri.
240
240
241
241
The following environment variables are internal, but used to communicate between
242
242
different Miri binaries, and as such worth documenting:
0 commit comments