From 6c400b3e334d280af78de4ce8a8334e593e26193 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 22:01:32 +0200 Subject: [PATCH] More helpful error message if toolchain is not in PATH --- crates/ra_project_model/src/cargo_workspace.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 84008b2e34..0613310f1f 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs @@ -141,6 +141,11 @@ impl CargoWorkspace { cargo_toml: &Path, cargo_features: &CargoConfig, ) -> Result { + let _ = Command::new(cargo_binary()) + .arg("--version") + .status() + .context("failed to run `cargo --version`, is `cargo` in PATH?")?; + let mut meta = MetadataCommand::new(); meta.manifest_path(cargo_toml); if cargo_features.all_features {