File tree 3 files changed +15
-3
lines changed
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:
171
171
" env" ,
172
172
" MIRI_AUTO_OPS=no" ,
173
173
" ./miri" ,
174
- " check" ,
174
+ " cargo" ,
175
+ " clippy" , // make this `check` when working with a locally built rustc
175
176
" --message-format=json"
176
177
],
177
178
// Contrary to what the name suggests, this also affects proc macros.
178
179
"rust-analyzer.cargo.buildScripts.overrideCommand" : [
179
180
" env" ,
180
181
" MIRI_AUTO_OPS=no" ,
181
182
" ./miri" ,
183
+ " cargo" ,
182
184
" check" ,
183
185
" --message-format=json" ,
184
186
],
Original file line number Diff line number Diff line change 1
1
#! /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>.
3
4
exec " $( 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`.
29
29
./miri clippy <flags>:
30
30
Runs clippy on all sources. <flags> are passed to `cargo clippy`.
31
31
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
+
32
36
./miri many-seeds <command>:
33
37
Runs <command> over and over again with different seeds for Miri. The MIRIFLAGS
34
38
variable is set to its original value appended with ` -Zmiri-seed=$SEED` for
@@ -44,7 +48,7 @@ MIRI_SYSROOT:
44
48
If already set, the "sysroot setup" step is skipped.
45
49
46
50
CARGO_EXTRA_FLAGS:
47
- Pass extra flags to all cargo invocations.
51
+ Pass extra flags to all cargo invocations. (Ignored by `./miri cargo`.)
48
52
EOF
49
53
)
50
54
@@ -218,6 +222,11 @@ clippy)
218
222
$CARGO clippy $CARGO_EXTRA_FLAGS --manifest-path " $MIRIDIR " /ui_test/Cargo.toml --all-targets " $@ "
219
223
$CARGO clippy $CARGO_EXTRA_FLAGS --manifest-path " $MIRIDIR " /cargo-miri/Cargo.toml " $@ "
220
224
;;
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
+ ;;
221
230
* )
222
231
if [ -n " $COMMAND " ]; then
223
232
echo " Unknown command: $COMMAND "
You can’t perform that action at this time.
0 commit comments