Auto merge of #3034 - RalfJung:ra, r=RalfJung
update recommended RA config Looks like rust-analyzer.checkOnSave.overrideCommand got renamed to rust-analyzer.check.overrideCommand.
This commit is contained in:
commit
a5ba57e415
3 changed files with 13 additions and 6 deletions
|
|
@ -165,16 +165,17 @@ to `.vscode/settings.json` in your local Miri clone:
|
|||
{
|
||||
"rust-analyzer.rustc.source": "discover",
|
||||
"rust-analyzer.linkedProjects": [
|
||||
"./Cargo.toml",
|
||||
"./cargo-miri/Cargo.toml"
|
||||
"Cargo.toml",
|
||||
"cargo-miri/Cargo.toml",
|
||||
"miri-script/Cargo.toml",
|
||||
],
|
||||
"rust-analyzer.checkOnSave.overrideCommand": [
|
||||
"rust-analyzer.check.overrideCommand": [
|
||||
"env",
|
||||
"MIRI_AUTO_OPS=no",
|
||||
"./miri",
|
||||
"cargo",
|
||||
"clippy", // make this `check` when working with a locally built rustc
|
||||
"--message-format=json"
|
||||
"--message-format=json",
|
||||
],
|
||||
// Contrary to what the name suggests, this also affects proc macros.
|
||||
"rust-analyzer.cargo.buildScripts.overrideCommand": [
|
||||
|
|
|
|||
|
|
@ -458,8 +458,8 @@ Some native rustc `-Z` flags are also very relevant for Miri:
|
|||
Moreover, Miri recognizes some environment variables:
|
||||
|
||||
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup
|
||||
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.
|
||||
should be skipped. If it is set to `no`, they are skipped. This is used to allow automated IDE
|
||||
actions to avoid the auto ops.
|
||||
* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
|
||||
Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
|
||||
* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ impl MiriEnv {
|
|||
|
||||
impl Command {
|
||||
fn auto_actions() -> Result<()> {
|
||||
if env::var_os("MIRI_AUTO_OPS").is_some_and(|x| x == "no") {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let miri_dir = miri_dir()?;
|
||||
let auto_everything = path!(miri_dir / ".auto-everything").exists();
|
||||
let auto_toolchain = auto_everything || path!(miri_dir / ".auto-toolchain").exists();
|
||||
|
|
@ -78,6 +82,7 @@ impl Command {
|
|||
}
|
||||
|
||||
pub fn exec(self) -> Result<()> {
|
||||
// First, and crucially only once, run the auto-actions -- but not for all commands.
|
||||
match &self {
|
||||
Command::Install { .. }
|
||||
| Command::Build { .. }
|
||||
|
|
@ -93,6 +98,7 @@ impl Command {
|
|||
| Command::Bench { .. }
|
||||
| Command::RustcPush { .. } => {}
|
||||
}
|
||||
// Then run the actual command.
|
||||
match self {
|
||||
Command::Install { flags } => Self::install(flags),
|
||||
Command::Build { flags } => Self::build(flags),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue