Skip to content

Commit e66d6ec

Browse files
authored
Merge pull request #660 from rust-lang/readme
README: mention --exclude-should-panic
2 parents a6cbc05 + 8c74325 commit e66d6ec

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ You can pass arguments to Miri after the first `--`, and pass arguments to the
6161
interpreted program or test suite after the second `--`. For example, `cargo
6262
+nightly miri run -- -Zmiri-disable-validation` runs the program without
6363
validation of basic type invariants and references. `cargo +nightly miri test
64-
-- -- filter` passes `filter` to the test suite the same way `cargo test filter`
65-
would.
64+
-- -- -Zunstable-options --exclude-should-panic` skips `#[should_panic]` tests,
65+
which is a good idea because Miri does not support unwinding or catching panics.
6666

6767
When running code via `cargo miri`, the `miri` config flag is set. You can
6868
use this to exclude test cases that will fail under Miri because they do things

src/bin/cargo-miri.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,8 @@ fn in_cargo_miri() {
329329
"badly formatted cargo metadata: target::kind is an empty array",
330330
);
331331
// Now we run `cargo rustc $FLAGS $ARGS`, giving the user the
332-
// change to add additional flags. `FLAGS` is set to identify
332+
// change to add additional arguments. `FLAGS` is set to identify
333333
// this target. The user gets to control what gets actually passed to Miri.
334-
// However, we need to add a flag to what gets passed to rustc for the finaly
335-
// binary, so that we know to interpret that with Miri.
336-
// So after the first `--`, we add `-Zcargo-miri-marker`.
337334
let mut cmd = Command::new("cargo");
338335
cmd.arg("rustc");
339336
match (subcommand, kind.as_str()) {
@@ -363,7 +360,8 @@ fn in_cargo_miri() {
363360
cmd.arg(arg);
364361
}
365362
// Add `--` (to end the `cargo` flags), and then the user flags. We add markers around the
366-
// user flags to be able to identify them later.
363+
// user flags to be able to identify them later. "cargo rustc" adds more stuff after this,
364+
// so we have to mark both the beginning and the end.
367365
cmd
368366
.arg("--")
369367
.arg("cargo-miri-marker-begin")

0 commit comments

Comments
 (0)