Skip to content

Commit 9f99aa9

Browse files
committed
Auto merge of #2505 - RalfJung:ui-test, r=oli-obk
cope with rustc aborting due to a signal `status.code().unwrap()` will panic when the process is aborted due to a signal. Let's not do that.
2 parents 53138c6 + 1914b61 commit 9f99aa9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui_test/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ pub fn run_tests(mut config: Config) -> Result<()> {
272272
}
273273
Error::ErrorsWithoutPattern { path: None, msgs } => {
274274
eprintln!(
275-
"There were {} unmatched diagnostics that occurred outside the testfile and had not pattern",
275+
"There were {} unmatched diagnostics that occurred outside the testfile and had no pattern",
276276
msgs.len(),
277277
);
278278
for Message { level, message } in msgs {
@@ -629,8 +629,8 @@ pub enum Mode {
629629

630630
impl Mode {
631631
fn ok(self, status: ExitStatus) -> Errors {
632-
match (status.code().unwrap(), self) {
633-
(1, Mode::Fail) | (101, Mode::Panic) | (0, Mode::Pass) => vec![],
632+
match (status.code(), self) {
633+
(Some(1), Mode::Fail) | (Some(101), Mode::Panic) | (Some(0), Mode::Pass) => vec![],
634634
_ => vec![Error::ExitStatus(self, status)],
635635
}
636636
}

0 commit comments

Comments
 (0)