Skip to content

Commit 2abfa87

Browse files
committed
readme: document how to directly invoke the driver
1 parent 8fd150c commit 2abfa87

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,21 @@ such races.
246246

247247
Note: `cargo-nextest` does not support doctests, see https://github.com/nextest-rs/nextest/issues/16
248248

249+
### Directly invoking the `miri` driver
250+
251+
The recommended way to invoke Miri is via `cargo miri`. Directly invoking the underlying `miri`
252+
driver is not supported, which is why that binary is not even installed into the PATH. However, if
253+
you need to run Miri on many small tests and want to invoke it directly like you would invoke
254+
`rustc`, that is still possible with a bit of extra effort:
255+
256+
```sh
257+
# one-time setup
258+
cargo +nightly miri setup
259+
SYSROOT=$(cargo +nightly miri setup --print-sysroot)
260+
# per file
261+
~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/miri --sysroot "$SYSROOT" file.rs
262+
```
263+
249264
### Common Problems
250265

251266
When using the above instructions, you may encounter a number of confusing compiler

0 commit comments

Comments
 (0)