aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-19 15:34:11 +0100
committerAleksey Kladov <[email protected]>2020-08-19 15:34:11 +0100
commit73f4fcbd0fa033947421f827e073bceee86e6447 (patch)
tree46a4324cfc9aef3601dbff3052975de9278882a6 /crates/project_model
parent70fd5428226bfc6c75314a987a643b8e7d82fb31 (diff)
Better error if Cargo is not in Path
Diffstat (limited to 'crates/project_model')
-rw-r--r--crates/project_model/src/lib.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/project_model/src/lib.rs b/crates/project_model/src/lib.rs
index 1f5a94d7f..84d1303db 100644
--- a/crates/project_model/src/lib.rs
+++ b/crates/project_model/src/lib.rs
@@ -151,11 +151,18 @@ impl ProjectWorkspace {
151 ProjectWorkspace::Json { project } 151 ProjectWorkspace::Json { project }
152 } 152 }
153 ProjectManifest::CargoToml(cargo_toml) => { 153 ProjectManifest::CargoToml(cargo_toml) => {
154 let cargo_version = utf8_stdout({
155 let mut cmd = Command::new(toolchain::cargo());
156 cmd.arg("--version");
157 cmd
158 })?;
159
154 let cargo = CargoWorkspace::from_cargo_metadata(&cargo_toml, cargo_config) 160 let cargo = CargoWorkspace::from_cargo_metadata(&cargo_toml, cargo_config)
155 .with_context(|| { 161 .with_context(|| {
156 format!( 162 format!(
157 "Failed to read Cargo metadata from Cargo.toml file {}", 163 "Failed to read Cargo metadata from Cargo.toml file {}, {}",
158 cargo_toml.display() 164 cargo_toml.display(),
165 cargo_version
159 ) 166 )
160 })?; 167 })?;
161 let sysroot = if with_sysroot { 168 let sysroot = if with_sysroot {