diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-08 17:54:38 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-08 17:54:38 +0100 |
commit | d81e19286f8d944af5697913acd7d25a7ed8c3ad (patch) | |
tree | cecc3346f5d1f7926c4f4e9ac79eb009f27b5612 /crates/ra_project_model/src/lib.rs | |
parent | d3eb9d8eafbebca7da95fa8a4813b92eb5080500 (diff) | |
parent | f739e0119c0d74c155f91ad27616a638fe494e2d (diff) |
Merge #4378
4378: Add stderr to error message r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_project_model/src/lib.rs')
-rw-r--r-- | crates/ra_project_model/src/lib.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 5a0a87ed7..3adb8baf6 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -600,7 +600,12 @@ pub fn get_rustc_cfg_options(target: Option<&String>) -> CfgOptions { | |||
600 | fn output(mut cmd: Command) -> Result<Output> { | 600 | fn output(mut cmd: Command) -> Result<Output> { |
601 | let output = cmd.output().with_context(|| format!("{:?} failed", cmd))?; | 601 | let output = cmd.output().with_context(|| format!("{:?} failed", cmd))?; |
602 | if !output.status.success() { | 602 | if !output.status.success() { |
603 | bail!("{:?} failed, {}", cmd, output.status) | 603 | match String::from_utf8(output.stderr) { |
604 | Ok(stderr) if !stderr.is_empty() => { | ||
605 | bail!("{:?} failed, {}\nstderr:\n{}", cmd, output.status, stderr) | ||
606 | } | ||
607 | _ => bail!("{:?} failed, {}", cmd, output.status), | ||
608 | } | ||
604 | } | 609 | } |
605 | Ok(output) | 610 | Ok(output) |
606 | } | 611 | } |