Auto merge of #2410 - rust-lang:miri_auto_ops, r=RalfJung

Some cleanups and docs around the auto ops
This commit is contained in:
bors 2022-07-21 15:31:40 +00:00
commit 69a4eaa187
3 changed files with 9 additions and 2 deletions

View File

@ -168,11 +168,15 @@ to `.vscode/settings.json` in your local Miri clone:
"./cargo-miri/Cargo.toml" "./cargo-miri/Cargo.toml"
], ],
"rust-analyzer.checkOnSave.overrideCommand": [ "rust-analyzer.checkOnSave.overrideCommand": [
"env",
"MIRI_AUTO_OPS=no",
"./miri", "./miri",
"check", "check",
"--message-format=json" "--message-format=json"
], ],
"rust-analyzer.buildScripts.overrideCommand": [ "rust-analyzer.buildScripts.overrideCommand": [
"env",
"MIRI_AUTO_OPS=no",
"./miri", "./miri",
"check", "check",
"--message-format=json", "--message-format=json",

View File

@ -393,6 +393,9 @@ Some native rustc `-Z` flags are also very relevant for Miri:
Moreover, Miri recognizes some environment variables: Moreover, Miri recognizes some environment variables:
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and rustup-toolchain
should be skipped. If it is set to any value, they are skipped. This is used for avoiding
infinite recursion in `./miri` and to allow automated IDE actions to avoid the auto ops.
* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during * `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri]. Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra * `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra

4
miri
View File

@ -53,8 +53,8 @@ EOF
MIRIDIR=$(python3 -c 'import os, sys; print(os.path.dirname(os.path.realpath(sys.argv[1])))' "$0") MIRIDIR=$(python3 -c 'import os, sys; print(os.path.dirname(os.path.realpath(sys.argv[1])))' "$0")
## Run the auto-things. ## Run the auto-things.
if [ -z "$AUTO_OPS" ]; then if [ -z "$MIRI_AUTO_OPS" ]; then
export AUTO_OPS=42 export MIRI_AUTO_OPS=42
# Run this first, so that the toolchain doesn't change after # Run this first, so that the toolchain doesn't change after
# other code has run. # other code has run.