Skip to content

Commit

Permalink
More conservative on error codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Nov 6, 2018
1 parent 0203cae commit 6bc5e71
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,16 @@ fn rustc<'a, 'cfg>(
}

fn internal_if_simple_exit_code(err: Error) -> Error {
if err
// If a signal on unix (code == None) or an abnormal termination
// on Windows (codes like 0xC0000409), don't hide the error details.
match err
.downcast_ref::<ProcessError>()
.as_ref()
.and_then(|perr| perr.exit.and_then(|e| e.code()))
!= Some(1)
{
return err;
Some(n) if n < 128 => Internal::new(err).into(),
_ => err,
}
Internal::new(err).into()
}

state.running(&rustc);
Expand Down

0 comments on commit 6bc5e71

Please sign in to comment.