The first time you run Miri, it will perform some extra setup and install some
dependencies. It will ask you for confirmation before installing anything.
+You can pass arguments to Miri after the first `--`, and pass arguments to the
+interpreted program or test suite after the second `--`. For example, `cargo
+miri run -- -Zmiri-disable-stacked-borrows` runs the program without checking
+the aliasing of references. To filter the tests being run, use `cargo miri test
+-- -- filter`.
+
Miri supports cross-execution: if you want to run the program as if it was a
Linux program, you can do `cargo miri run --target x86_64-unknown-linux-gnu`.
This is particularly useful if you are using Windows, as the Linux target is
much better supported than Windows targets.
-You can pass arguments to Miri after the first `--`, and pass arguments to the
-interpreted program or test suite after the second `--`. For example, `cargo
-miri run -- -Zmiri-disable-validation` runs the program without validation of
-basic type invariants and without checking the aliasing of references.
-
When compiling code via `cargo miri`, the `miri` config flag is set. You can
use this to ignore test cases that fail under Miri because they do things Miri
does not support:
const CARGO_MIRI_HELP: &str = r#"Interprets bin crates and tests in Miri
Usage:
- cargo miri [subcommand] [options] [--] [<miri opts>...] [--] [<program opts>...]
+ cargo miri [subcommand] [<cargo options>...] [--] [<miri options>...] [--] [<program/test suite options>...]
Subcommands:
run Run binaries (default)
Other [options] are the same as `cargo check`. Everything after the first "--" is
passed verbatim to Miri, which will pass everything after the second "--" verbatim
to the interpreted program.
+
+Examples:
+ cargo miri run -- -Zmiri-disable-stacked-borrows
+ cargo miri test -- -- test-suite-filter
"#;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]