Skip to content

Commit 1d19084

Browse files
bors[bot]matklad
andauthored
Merge #5816
5816: Better error if Cargo is not in Path r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 22d2e34 + 73f4fcb commit 1d19084

File tree

1 file changed

+9
-2
lines changed
  • crates/project_model/src

1 file changed

+9
-2
lines changed

crates/project_model/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,18 @@ impl ProjectWorkspace {
151151
ProjectWorkspace::Json { project }
152152
}
153153
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+
154160
let cargo = CargoWorkspace::from_cargo_metadata(&cargo_toml, cargo_config)
155161
.with_context(|| {
156162
format!(
157-
"Failed to read Cargo metadata from Cargo.toml file {}",
158-
cargo_toml.display()
163+
"Failed to read Cargo metadata from Cargo.toml file {}, {}",
164+
cargo_toml.display(),
165+
cargo_version
159166
)
160167
})?;
161168
let sysroot = if with_sysroot {

0 commit comments

Comments
 (0)