From 73f4fcbd0fa033947421f827e073bceee86e6447 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 19 Aug 2020 16:34:11 +0200 Subject: Better error if Cargo is not in Path --- crates/project_model/src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crates/project_model/src') 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 { ProjectWorkspace::Json { project } } ProjectManifest::CargoToml(cargo_toml) => { + let cargo_version = utf8_stdout({ + let mut cmd = Command::new(toolchain::cargo()); + cmd.arg("--version"); + cmd + })?; + let cargo = CargoWorkspace::from_cargo_metadata(&cargo_toml, cargo_config) .with_context(|| { format!( - "Failed to read Cargo metadata from Cargo.toml file {}", - cargo_toml.display() + "Failed to read Cargo metadata from Cargo.toml file {}, {}", + cargo_toml.display(), + cargo_version ) })?; let sysroot = if with_sysroot { -- cgit v1.2.3