diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 1682d8bde2..93cf6a3d68 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -215,6 +215,7 @@ impl FlycheckActor { } => { let mut cmd = Command::new(toolchain::cargo()); cmd.arg(command); + cmd.current_dir(&self.workspace_root); cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]) .arg(self.workspace_root.join("Cargo.toml")); diff --git a/crates/project_model/src/build_data.rs b/crates/project_model/src/build_data.rs index 7b88dca630..3aa546980c 100644 --- a/crates/project_model/src/build_data.rs +++ b/crates/project_model/src/build_data.rs @@ -143,6 +143,7 @@ impl WorkspaceBuildData { cmd.env("RA_RUSTC_WRAPPER", "1"); } + cmd.current_dir(cargo_toml.parent().unwrap()); cmd.args(&["check", "--quiet", "--workspace", "--message-format=json", "--manifest-path"]) .arg(cargo_toml.as_ref());