aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-24 21:01:32 +0100
committerAleksey Kladov <[email protected]>2020-04-24 21:01:32 +0100
commit6c400b3e334d280af78de4ce8a8334e593e26193 (patch)
tree5567322f71d092959a44a937ef2ce9d2d4800fe9
parent5d97667f8dd467e7382885fcae40bcdbac63ae4f (diff)
More helpful error message if toolchain is not in PATH
-rw-r--r--crates/ra_project_model/src/cargo_workspace.rs5
1 files changed, 5 insertions, 0 deletions
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 {
141 cargo_toml: &Path, 141 cargo_toml: &Path,
142 cargo_features: &CargoConfig, 142 cargo_features: &CargoConfig,
143 ) -> Result<CargoWorkspace> { 143 ) -> Result<CargoWorkspace> {
144 let _ = Command::new(cargo_binary())
145 .arg("--version")
146 .status()
147 .context("failed to run `cargo --version`, is `cargo` in PATH?")?;
148
144 let mut meta = MetadataCommand::new(); 149 let mut meta = MetadataCommand::new();
145 meta.manifest_path(cargo_toml); 150 meta.manifest_path(cargo_toml);
146 if cargo_features.all_features { 151 if cargo_features.all_features {