diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-19 15:34:36 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-19 15:34:36 +0100 |
commit | 1d19084317fd183ca8a1632cbff1112e72e5969f (patch) | |
tree | 46a4324cfc9aef3601dbff3052975de9278882a6 /crates/project_model | |
parent | 22d2e34bf3c189cacaeee66a1dae2ac08e6cf166 (diff) | |
parent | 73f4fcbd0fa033947421f827e073bceee86e6447 (diff) |
Merge #5816
5816: Better error if Cargo is not in Path
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/project_model')
-rw-r--r-- | crates/project_model/src/lib.rs | 11 |
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 { |