]> git.lizzy.rs Git - rust.git/commitdiff
mention --exclude-should-panic
authorRalf Jung <post@ralfj.de>
Sun, 10 Mar 2019 16:53:30 +0000 (17:53 +0100)
committerRalf Jung <post@ralfj.de>
Sun, 10 Mar 2019 16:53:30 +0000 (17:53 +0100)
README.md
src/bin/cargo-miri.rs

index aef74d6a5fe64b6cbf5075ed225333c9a86fbb53..184e37a894a9e088aa1fe0a548311747744cc18c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -61,8 +61,8 @@ 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
 +nightly miri run -- -Zmiri-disable-validation` runs the program without
 validation of basic type invariants and references.  `cargo +nightly miri test
--- -- filter` passes `filter` to the test suite the same way `cargo test filter`
-would.
+-- -- -Zunstable-options --exclude-should-panic` skips `#[should_panic]` tests,
+which is a good idea because Miri does not support unwinding or catching panics.
 
 When running code via `cargo miri`, the `miri` config flag is set.  You can
 use this to exclude test cases that will fail under Miri because they do things
index 0c90e8ade0d26f0cac1dfbf586a53fad3019fe04..50570554f450c4805fdd7f6cee30b7f614630ef9 100644 (file)
@@ -329,11 +329,8 @@ fn in_cargo_miri() {
             "badly formatted cargo metadata: target::kind is an empty array",
         );
         // Now we run `cargo rustc $FLAGS $ARGS`, giving the user the
-        // change to add additional flags. `FLAGS` is set to identify
+        // change to add additional arguments. `FLAGS` is set to identify
         // this target.  The user gets to control what gets actually passed to Miri.
-        // However, we need to add a flag to what gets passed to rustc for the finaly
-        // binary, so that we know to interpret that with Miri.
-        // So after the first `--`, we add `-Zcargo-miri-marker`.
         let mut cmd = Command::new("cargo");
         cmd.arg("rustc");
         match (subcommand, kind.as_str()) {
@@ -363,7 +360,8 @@ fn in_cargo_miri() {
             cmd.arg(arg);
         }
         // Add `--` (to end the `cargo` flags), and then the user flags. We add markers around the
-        // user flags to be able to identify them later.
+        // user flags to be able to identify them later.  "cargo rustc" adds more stuff after this,
+        // so we have to mark both the beginning and the end.
         cmd
             .arg("--")
             .arg("cargo-miri-marker-begin")