Skip to content

Commit 5347411

Browse files
committed
README: remove "specific nightly" instructions and use +nightly throughout
Also replace `cargo miri test` with `cargo miri` in general examples.
1 parent abda1a8 commit 5347411

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

README.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ undergraduate research course at the [University of Saskatchewan][usask].
88
## Building Miri
99

1010
I recommend that you install [rustup][rustup] to obtain Rust. Miri comes with a
11-
`rust-toolchain` file so rustup will automatically pick a suitable nightly
12-
version. Then all you have to do is:
11+
`rust-version` file describing the latest supported nightly version of the Rust
12+
compiler toolchain. Then all you have to do is:
1313

1414
```sh
15-
cargo build
15+
cargo +nightly build
1616
```
1717

18+
with `+nightly` replaced with the appropriate nightly version of Rust.
19+
1820
## Running Miri
1921

2022
```sh
21-
cargo run tests/run-pass/vecs.rs # Or whatever test you like.
23+
cargo +nightly run tests/run-pass/vecs.rs # Or whatever test you like.
2224
```
2325

2426
## Running Miri with full libstd
@@ -28,15 +30,15 @@ Miri hits a call to such a function, execution terminates. To fix this, it is
2830
possible to compile libstd with full MIR:
2931

3032
```sh
31-
rustup component add rust-src
32-
cargo install xargo
33-
xargo/build.sh
33+
rustup component add --toolchain nightly rust-src
34+
cargo +nightly install xargo
35+
rustup run nightly xargo/build.sh
3436
```
3537

3638
Now you can run Miri against the libstd compiled by xargo:
3739

3840
```sh
39-
MIRI_SYSROOT=~/.xargo/HOST cargo run tests/run-pass-fullmir/hashmap.rs
41+
MIRI_SYSROOT=~/.xargo/HOST cargo +nightly run tests/run-pass-fullmir/hashmap.rs
4042
```
4143

4244
Notice that you will have to re-run the last step of the preparations above when
@@ -47,7 +49,7 @@ You can also set `-Zmiri-start-fn` to make Miri start evaluation with the
4749

4850
## Running Miri on your own project('s test suite)
4951

50-
Install Miri as a cargo subcommand with `cargo install --all-features --path .`.
52+
Install Miri as a cargo subcommand with `cargo install +nightly --all-features --path .`.
5153

5254
Compile your project and its dependencies against a MIR-enabled libstd as described
5355
above:
@@ -61,12 +63,12 @@ the non-MIR `libstd`.
6163

6264
### Common Problems
6365

64-
When modifying the above instructions, you may encounter a number of confusing compiler
66+
When using the above instructions, you may encounter a number of confusing compiler
6567
errors.
6668

6769
#### "constant evaluation error: no mir for `<function>`"
6870

69-
You may have forgotten to set `MIRI_SYSROOT` when calling `cargo miri test`, and
71+
You may have forgotten to set `MIRI_SYSROOT` when calling `cargo miri`, and
7072
your program called into `std` or `core`. Be sure to set `MIRI_SYSROOT=~/.xargo/HOST`.
7173

7274
#### "found possibly newer version of crate `std` which `<dependency>` depends on"
@@ -77,21 +79,9 @@ builds and vice-versa.
7779

7880
#### "found crate `std` compiled by an incompatible version of rustc"
7981

80-
You may be running `cargo miri test` with a different compiler version than the one
82+
You may be running `cargo miri` with a different compiler version than the one
8183
used to build the MIR-enabled `std`. Be sure to consistently use the same toolchain,
82-
perhaps by following the below instructions to specify a specific nightly for use
83-
with Miri.
84-
85-
## Using Rustup To Specify a Specific Nightly
86-
87-
To target a specific nightly, modify the above instructions as follows. It is recommended
88-
to use the nightly specified in the `rust-version` file in this repo, since that is the
89-
most recent nightly supported by Miri.
90-
91-
1. Install Miri using `cargo +nightly-2018-10-15 install --all-features --path .`,
92-
with the date replaced as appropriate.
93-
2. Run `xargo/build.sh` as `rustup run nightly-2018-10-15 xargo/build.sh`.
94-
3. When running tests, use `MIRI_SYSROOT=~/.xargo/HOST cargo +nightly-2018-10-15 miri test`.
84+
which should be the toolchain specified in the `rust-version` file.
9585

9686
## Miri `-Z` flags
9787

0 commit comments

Comments
 (0)