Skip to content

Commit 6914420

Browse files
committed
update suggested RA config; the './miri cargo' command is not needed any more
1 parent e83018d commit 6914420

File tree

4 files changed

+6
-21
lines changed

4 files changed

+6
-21
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,24 +173,24 @@ to `.vscode/settings.json` in your local Miri clone:
173173
"cargo-miri/Cargo.toml",
174174
"miri-script/Cargo.toml",
175175
],
176+
"rust-analyzer.check.invocationLocation": "root",
177+
"rust-analyzer.check.invocationStrategy": "once",
176178
"rust-analyzer.check.overrideCommand": [
177179
"env",
178180
"MIRI_AUTO_OPS=no",
179181
"./miri",
180-
"cargo",
181182
"clippy", // make this `check` when working with a locally built rustc
182183
"--message-format=json",
183-
"--all-targets",
184184
],
185185
// Contrary to what the name suggests, this also affects proc macros.
186+
"rust-analyzer.cargo.buildScripts.invocationLocation": "root",
187+
"rust-analyzer.cargo.buildScripts.invocationStrategy": "once",
186188
"rust-analyzer.cargo.buildScripts.overrideCommand": [
187189
"env",
188190
"MIRI_AUTO_OPS=no",
189191
"./miri",
190-
"cargo",
191192
"check",
192193
"--message-format=json",
193-
"--all-targets",
194194
],
195195
}
196196
```

miri-script/src/commands.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ impl Command {
168168
| Command::Test { .. }
169169
| Command::Run { .. }
170170
| Command::Fmt { .. }
171-
| Command::Clippy { .. }
172-
| Command::Cargo { .. } => Self::auto_actions()?,
171+
| Command::Clippy { .. } => Self::auto_actions()?,
173172
| Command::Toolchain { .. }
174173
| Command::Bench { .. }
175174
| Command::RustcPull { .. }
@@ -185,7 +184,6 @@ impl Command {
185184
Self::run(dep, verbose, many_seeds, target, edition, flags),
186185
Command::Fmt { flags } => Self::fmt(flags),
187186
Command::Clippy { flags } => Self::clippy(flags),
188-
Command::Cargo { flags } => Self::cargo(flags),
189187
Command::Bench { target, benches } => Self::bench(target, benches),
190188
Command::Toolchain { flags } => Self::toolchain(flags),
191189
Command::RustcPull { commit } => Self::rustc_pull(commit.clone()),
@@ -464,15 +462,6 @@ impl Command {
464462
Ok(())
465463
}
466464

467-
fn cargo(flags: Vec<String>) -> Result<()> {
468-
let e = MiriEnv::new()?;
469-
let toolchain = &e.toolchain;
470-
// We carefully kept the working dir intact, so this will run cargo *on the workspace in the
471-
// current working dir*, not on the main Miri workspace. That is exactly what RA needs.
472-
cmd!(e.sh, "cargo +{toolchain} {flags...}").run()?;
473-
Ok(())
474-
}
475-
476465
fn test(bless: bool, mut flags: Vec<String>, target: Option<String>) -> Result<()> {
477466
let mut e = MiriEnv::new()?;
478467

miri-script/src/main.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ pub enum Command {
5858
/// Flags that are passed through to `cargo clippy`.
5959
flags: Vec<String>,
6060
},
61-
/// Runs just `cargo <flags>` with the Miri-specific environment variables.
62-
/// Mainly meant to be invoked by rust-analyzer.
63-
Cargo { flags: Vec<String> },
6461
/// Runs the benchmarks from bench-cargo-miri in hyperfine. hyperfine needs to be installed.
6562
Bench {
6663
target: Option<String>,
@@ -205,7 +202,6 @@ fn main() -> Result<()> {
205202
}
206203
Some("fmt") => Command::Fmt { flags: args.remainder() },
207204
Some("clippy") => Command::Clippy { flags: args.remainder() },
208-
Some("cargo") => Command::Cargo { flags: args.remainder() },
209205
Some("install") => Command::Install { flags: args.remainder() },
210206
Some("bench") => {
211207
let mut target = None;

miri-script/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub struct MiriEnv {
3434
/// miri_dir is the root of the miri repository checkout we are working in.
3535
pub miri_dir: PathBuf,
3636
/// active_toolchain is passed as `+toolchain` argument to cargo/rustc invocations.
37-
pub toolchain: String,
37+
toolchain: String,
3838
/// Extra flags to pass to cargo.
3939
cargo_extra_flags: Vec<String>,
4040
/// The rustc sysroot

0 commit comments

Comments
 (0)