From 6c400b3e334d280af78de4ce8a8334e593e26193 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 22:01:32 +0200 Subject: More helpful error message if toolchain is not in PATH --- crates/ra_project_model/src/cargo_workspace.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/ra_project_model') diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 84008b2e3..0613310f1 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 { -- cgit v1.2.3