File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -165,16 +165,17 @@ to `.vscode/settings.json` in your local Miri clone:
165165{
166166 "rust-analyzer.rustc.source" : " discover" ,
167167 "rust-analyzer.linkedProjects" : [
168- " ./Cargo.toml" ,
169- " ./cargo-miri/Cargo.toml"
168+ " Cargo.toml" ,
169+ " cargo-miri/Cargo.toml" ,
170+ " miri-script/Cargo.toml" ,
170171 ],
171- "rust-analyzer.checkOnSave .overrideCommand" : [
172+ "rust-analyzer.check .overrideCommand" : [
172173 " env" ,
173174 " MIRI_AUTO_OPS=no" ,
174175 " ./miri" ,
175176 " cargo" ,
176177 " clippy" , // make this `check` when working with a locally built rustc
177- " --message-format=json"
178+ " --message-format=json" ,
178179 ],
179180 // Contrary to what the name suggests, this also affects proc macros.
180181 "rust-analyzer.cargo.buildScripts.overrideCommand" : [
Original file line number Diff line number Diff line change @@ -458,8 +458,8 @@ Some native rustc `-Z` flags are also very relevant for Miri:
458458Moreover, Miri recognizes some environment variables :
459459
460460* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup
461- should be skipped. If it is set to any value , they are skipped. This is used for avoiding infinite
462- recursion in `./miri` and to allow automated IDE actions to avoid the auto ops.
461+ should be skipped. If it is set to `no` , they are skipped. This is used to allow automated IDE
462+ actions to avoid the auto ops.
463463* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
464464 Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
465465* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ impl MiriEnv {
5757
5858impl Command {
5959 fn auto_actions ( ) -> Result < ( ) > {
60+ if env:: var_os ( "MIRI_AUTO_OPS" ) . is_some_and ( |x| x == "no" ) {
61+ return Ok ( ( ) ) ;
62+ }
63+
6064 let miri_dir = miri_dir ( ) ?;
6165 let auto_everything = path ! ( miri_dir / ".auto-everything" ) . exists ( ) ;
6266 let auto_toolchain = auto_everything || path ! ( miri_dir / ".auto-toolchain" ) . exists ( ) ;
@@ -78,6 +82,7 @@ impl Command {
7882 }
7983
8084 pub fn exec ( self ) -> Result < ( ) > {
85+ // First, and crucially only once, run the auto-actions -- but not for all commands.
8186 match & self {
8287 Command :: Install { .. }
8388 | Command :: Build { .. }
@@ -93,6 +98,7 @@ impl Command {
9398 | Command :: Bench { .. }
9499 | Command :: RustcPush { .. } => { }
95100 }
101+ // Then run the actual command.
96102 match self {
97103 Command :: Install { flags } => Self :: install ( flags) ,
98104 Command :: Build { flags } => Self :: build ( flags) ,
You can’t perform that action at this time.
0 commit comments