File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -171,14 +171,16 @@ to `.vscode/settings.json` in your local Miri clone:
171171 " env" ,
172172 " MIRI_AUTO_OPS=no" ,
173173 " ./miri" ,
174- " check" ,
174+ " cargo" ,
175+ " clippy" , // make this `check` when working with a locally built rustc
175176 " --message-format=json"
176177 ],
177178 // Contrary to what the name suggests, this also affects proc macros.
178179 "rust-analyzer.cargo.buildScripts.overrideCommand" : [
179180 " env" ,
180181 " MIRI_AUTO_OPS=no" ,
181182 " ./miri" ,
183+ " cargo" ,
182184 " check" ,
183185 " --message-format=json" ,
184186 ],
Original file line number Diff line number Diff line change 11#! /bin/sh
2- # Hack to work around https://github.com/rust-analyzer/rust-analyzer/issues/10793.
2+ # RA invokes `./miri cargo ...` for each workspace, so we need to forward that to the main `miri`
3+ # script. See <https://github.com/rust-analyzer/rust-analyzer/issues/10793>.
34exec " $( dirname " $0 " ) " /../miri " $@ "
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ Format all sources and tests. <flags> are passed to `rustfmt`.
2929./miri clippy <flags>:
3030Runs clippy on all sources. <flags> are passed to `cargo clippy`.
3131
32+ ./miri cargo <flags>:
33+ Runs just `cargo <flags>` with the Miri-specific environment variables.
34+ Mainly meant to be invoked by rust-analyzer.
35+
3236./miri many-seeds <command>:
3337Runs <command> over and over again with different seeds for Miri. The MIRIFLAGS
3438variable is set to its original value appended with ` -Zmiri-seed=$SEED` for
@@ -44,7 +48,7 @@ MIRI_SYSROOT:
4448If already set, the "sysroot setup" step is skipped.
4549
4650CARGO_EXTRA_FLAGS:
47- Pass extra flags to all cargo invocations.
51+ Pass extra flags to all cargo invocations. (Ignored by `./miri cargo`.)
4852EOF
4953)
5054
@@ -218,6 +222,11 @@ clippy)
218222 $CARGO clippy $CARGO_EXTRA_FLAGS --manifest-path " $MIRIDIR " /ui_test/Cargo.toml --all-targets " $@ "
219223 $CARGO clippy $CARGO_EXTRA_FLAGS --manifest-path " $MIRIDIR " /cargo-miri/Cargo.toml " $@ "
220224 ;;
225+ cargo)
226+ # We carefully kept the working dir intact, so this will run cargo *on the workspace in the
227+ # current working dir*, not on the main Miri workspace. That is exactly what RA needs.
228+ $CARGO " $@ "
229+ ;;
221230* )
222231 if [ -n " $COMMAND " ]; then
223232 echo " Unknown command: $COMMAND "
You can’t perform that action at this time.
0 commit comments