4127: More helpful error message if toolchain is not in PATH r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-04-24 20:03:33 +00:00 committed by GitHub
commit e55b1833ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,6 +141,11 @@ impl CargoWorkspace {
cargo_toml: &Path,
cargo_features: &CargoConfig,
) -> Result<CargoWorkspace> {
let _ = Command::new(cargo_binary())
.arg("--version")
.status()
.context("failed to run `cargo --version`, is `cargo` in PATH?")?;
let mut meta = MetadataCommand::new();
meta.manifest_path(cargo_toml);
if cargo_features.all_features {