@@ -39,10 +39,9 @@ program, and cannot run all programs:
39
39
addresses or other non-deterministic data, try running Miri with different
40
40
values for ` -Zmiri-seed ` to test different executions.
41
41
* Miri runs the program as a platform-independent interpreter, so the program
42
- has no access to any platform-specific APIs or FFI. A few APIs have been
42
+ has no access to most platform-specific APIs or FFI. A few APIs have been
43
43
implemented (such as printing to stdout) but most have not: for example, Miri
44
- currently does not support concurrency, or SIMD, or networking, or file system
45
- access.
44
+ currently does not support concurrency, or SIMD, or networking.
46
45
47
46
[ rust ] : https://www.rust-lang.org/
48
47
[ mir ] : https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
@@ -78,9 +77,7 @@ dependencies. It will ask you for confirmation before installing anything.
78
77
You can pass arguments to Miri after the first ` -- ` , and pass arguments to the
79
78
interpreted program or test suite after the second ` -- ` . For example, `cargo
80
79
miri run -- -Zmiri-disable-validation` runs the program without validation of
81
- basic type invariants and references. `cargo miri test -- -- -Zunstable-options
82
- --exclude-should-panic` skips ` #[ should_panic] ` tests, which is a good idea
83
- because Miri does not support unwinding or catching panics.
80
+ basic type invariants and without checking the aliasing of references.
84
81
85
82
When running code via ` cargo miri ` , the ` miri ` config flag is set. You can
86
83
use this to exclude test cases that will fail under Miri because they do things
@@ -90,8 +87,9 @@ Miri does not support:
90
87
#[cfg(not(miri))]
91
88
#[test]
92
89
fn does_not_work_on_miri () {
93
- let x = 0u8 ;
94
- assert! (& x as * const _ as usize % 4 < 4 );
90
+ std :: thread :: spawn (|| println! (" Hello Thread!" ))
91
+ . join ()
92
+ . unwrap ();
95
93
}
96
94
```
97
95
@@ -111,7 +109,7 @@ rustup default "$MIRI_NIGHTLY"
111
109
rustup component add miri
112
110
cargo miri setup
113
111
114
- cargo miri test -- -- -Zunstable-options --exclude-should-panic
112
+ cargo miri test
115
113
```
116
114
117
115
We use ` cargo miri setup ` to avoid getting interactive questions about the extra
@@ -154,10 +152,10 @@ Several `-Z` flags are relevant for Miri:
154
152
** NOTE** : This entropy is not good enough for cryptographic use! Do not
155
153
generate secret keys in Miri or perform other kinds of cryptographic
156
154
operations that rely on proper random numbers.
157
- * ` -Zmiri-disable-validation ` disables enforcing the validity invariant, which
158
- is enforced by default. This is mostly useful for debugging; it means Miri
159
- will miss bugs in your program. However, this can also help to make Miri run
160
- faster.
155
+ * ` -Zmiri-disable-validation ` disables enforcing validity invariants and
156
+ reference aliasing rules, which are enforced by default. This is mostly
157
+ useful for debugging. It means Miri will miss bugs in your program. However,
158
+ this can also help to make Miri run faster.
161
159
* ` -Zmiri-disable-isolation ` disables host host isolation. As a consequence,
162
160
the program has access to host resources such as environment variables and
163
161
randomness (and, eventually, file systems and more).
0 commit comments