diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-11-25 15:12:38 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-25 15:12:38 +0000 |
| commit | 870e730dc8a8a15f98468c08a5a7ec0e44dfc40d (patch) | |
| tree | 2157e2201f7c844bac18bd0caba5a8f193baca59 | |
| parent | 4ca6233bd2723c33152dcabd32f184d769d8339c (diff) | |
| parent | 03eb9f3abb2d3b49160fbe6cae59a33ab00eb645 (diff) | |
| download | rust-870e730dc8a8a15f98468c08a5a7ec0e44dfc40d.tar.gz rust-870e730dc8a8a15f98468c08a5a7ec0e44dfc40d.zip | |
Merge #10824
10824: project_model: print full cargo command if cargo metadata fails to run r=Veykril a=jhgg well, `Command` implements a sensible `Debug` which *roughly* does what we want to do. Unfortunately it's got a bit of a quote situation, So it'd output something like `"cargo" "metadata" "--format-version" "1" "--features" "foo,bar,baz"`. Which although is a bit verbose with the quotes, it's at the very least, not entirely incorrect/misleading. fixes #10797 Co-authored-by: Jake Heinz <jh@discordapp.com>
| -rw-r--r-- | crates/project_model/src/cargo_workspace.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs index 24b7398ee61..85123ed5c57 100644 --- a/crates/project_model/src/cargo_workspace.rs +++ b/crates/project_model/src/cargo_workspace.rs @@ -286,9 +286,8 @@ impl CargoWorkspace { // unclear whether cargo itself supports it. progress("metadata".to_string()); - let meta = meta.exec().with_context(|| { - format!("Failed to run `cargo metadata --manifest-path {}`", cargo_toml.display(),) - })?; + let meta = + meta.exec().with_context(|| format!("Failed to run `{:?}`", meta.cargo_command()))?; Ok(meta) } |
