Skip to content

Commit 6bc5e71

Browse files
committed
More conservative on error codes.
1 parent 0203cae commit 6bc5e71

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,16 @@ fn rustc<'a, 'cfg>(
277277
}
278278

279279
fn internal_if_simple_exit_code(err: Error) -> Error {
280-
if err
280+
// If a signal on unix (code == None) or an abnormal termination
281+
// on Windows (codes like 0xC0000409), don't hide the error details.
282+
match err
281283
.downcast_ref::<ProcessError>()
282284
.as_ref()
283285
.and_then(|perr| perr.exit.and_then(|e| e.code()))
284-
!= Some(1)
285286
{
286-
return err;
287+
Some(n) if n < 128 => Internal::new(err).into(),
288+
_ => err,
287289
}
288-
Internal::new(err).into()
289290
}
290291

291292
state.running(&rustc);

0 commit comments

Comments
 (0)