about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2022-10-24 16:07:42 +0200
committerLukas Wirth <lukastw97@gmail.com>2022-10-24 16:07:42 +0200
commitfbae83acd0f7e6ddc7002774451e4e8df6b94286 (patch)
tree8fe0ae9d960ec78c738e0935bcc390cabacdfe3e
parent43fb9563b2943d6abc5f3552195f3e27ac618966 (diff)
downloadrust-fbae83acd0f7e6ddc7002774451e4e8df6b94286.tar.gz
rust-fbae83acd0f7e6ddc7002774451e4e8df6b94286.zip
fix: Fix standard flycheck command not being executed in the workspace it is being invoked for
-rw-r--r--crates/flycheck/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
index 73c3a48b4c5..8a91d606661 100644
--- a/crates/flycheck/src/lib.rs
+++ b/crates/flycheck/src/lib.rs
@@ -295,7 +295,9 @@ impl FlycheckActor {
             } => {
                 let mut cmd = Command::new(toolchain::cargo());
                 cmd.arg(command);
-                cmd.args(&["--workspace", "--message-format=json"]);
+                cmd.current_dir(&self.root);
+                cmd.args(&["--workspace", "--message-format=json", "--manifest-path"])
+                    .arg(self.root.join("Cargo.toml").as_os_str());
 
                 if let Some(target) = target_triple {
                     cmd.args(&["--target", target.as_str()]);