Skip to content

update README #1104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ program, and cannot run all programs:
addresses or other non-deterministic data, try running Miri with different
values for `-Zmiri-seed` to test different executions.
* Miri runs the program as a platform-independent interpreter, so the program
has no access to any platform-specific APIs or FFI. A few APIs have been
has no access to most platform-specific APIs or FFI. A few APIs have been
implemented (such as printing to stdout) but most have not: for example, Miri
currently does not support concurrency, or SIMD, or networking, or file system
access.
currently does not support concurrency, or SIMD, or networking.

[rust]: https://www.rust-lang.org/
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
Expand Down Expand Up @@ -78,9 +77,7 @@ 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-validation` runs the program without validation of
basic type invariants and references. `cargo miri test -- -- -Zunstable-options
--exclude-should-panic` skips `#[should_panic]` tests, which is a good idea
because Miri does not support unwinding or catching panics.
basic type invariants and without checking the aliasing of references.

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
Expand All @@ -90,8 +87,9 @@ Miri does not support:
#[cfg(not(miri))]
#[test]
fn does_not_work_on_miri() {
let x = 0u8;
assert!(&x as *const _ as usize % 4 < 4);
std::thread::spawn(|| println!("Hello Thread!"))
.join()
.unwrap();
}
```

Expand All @@ -111,7 +109,7 @@ rustup default "$MIRI_NIGHTLY"
rustup component add miri
cargo miri setup

cargo miri test -- -- -Zunstable-options --exclude-should-panic
cargo miri test
```

We use `cargo miri setup` to avoid getting interactive questions about the extra
Expand Down Expand Up @@ -154,10 +152,10 @@ Several `-Z` flags are relevant for Miri:
**NOTE**: This entropy is not good enough for cryptographic use! Do not
generate secret keys in Miri or perform other kinds of cryptographic
operations that rely on proper random numbers.
* `-Zmiri-disable-validation` disables enforcing the validity invariant, which
is enforced by default. This is mostly useful for debugging; it means Miri
will miss bugs in your program. However, this can also help to make Miri run
faster.
* `-Zmiri-disable-validation` disables enforcing validity invariants and
reference aliasing rules, which are enforced by default. This is mostly
useful for debugging. It means Miri will miss bugs in your program. However,
this can also help to make Miri run faster.
* `-Zmiri-disable-isolation` disables host host isolation. As a consequence,
the program has access to host resources such as environment variables and
randomness (and, eventually, file systems and more).
Expand Down