Skip to content

Commit d81e192

Browse files
bors[bot]matklad
andauthored
Merge #4378
4378: Add stderr to error message r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents d3eb9d8 + f739e01 commit d81e192

File tree

1 file changed

+6
-1
lines changed
  • crates/ra_project_model/src

1 file changed

+6
-1
lines changed

crates/ra_project_model/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,12 @@ pub fn get_rustc_cfg_options(target: Option<&String>) -> CfgOptions {
600600
fn output(mut cmd: Command) -> Result<Output> {
601601
let output = cmd.output().with_context(|| format!("{:?} failed", cmd))?;
602602
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+
}
604609
}
605610
Ok(output)
606611
}

0 commit comments

Comments
 (0)