aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-08 17:53:53 +0100
committerAleksey Kladov <[email protected]>2020-05-08 17:53:53 +0100
commitf739e0119c0d74c155f91ad27616a638fe494e2d (patch)
tree8fa70b4284754d3cc95a77dee098e1ff23653ef1 /crates
parentecff5dc141046c5b9e40639657247a05fb9b0344 (diff)
Add stderr to error message
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_project_model/src/lib.rs7
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 {
600fn output(mut cmd: Command) -> Result<Output> { 600fn 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}