From 2c3c82c4c5a2e2b49d1bfac0ebeab6f5d14e5b8f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 3 Nov 2025 20:55:54 +0100 Subject: [PATCH] Add new `run_make_support::CompletedProcess::assert_ice` method --- src/tools/run-make-support/src/command.rs | 7 +++++++ .../diagnostics-traits-from-duplicate-crates/rmake.rs | 2 +- tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs | 2 +- tests/run-make/rustdoc-test-builder/rmake.rs | 7 +++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tools/run-make-support/src/command.rs b/src/tools/run-make-support/src/command.rs index b46ddd1d3154..0aeb189bb6a5 100644 --- a/src/tools/run-make-support/src/command.rs +++ b/src/tools/run-make-support/src/command.rs @@ -387,6 +387,13 @@ impl CompletedProcess { self } + /// Checks that `stderr` doesn't contain the Internal Compiler Error message. + #[track_caller] + pub fn assert_not_ice(&self) -> &Self { + self.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug"); + self + } + /// Checks that `stderr` does not contain the regex pattern `unexpected`. #[track_caller] pub fn assert_stderr_not_contains_regex>(&self, unexpected: S) -> &Self { diff --git a/tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs b/tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs index 5bc0a0c9519f..abd7b8cc8a8a 100644 --- a/tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs +++ b/tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs @@ -43,5 +43,5 @@ fn main() { .extern_("minibevy", "libminibevy-b.rmeta") .extern_("minirapier", "libminirapier.rmeta") .run_fail() - .assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug"); + .assert_not_ice(); } diff --git a/tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs b/tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs index 0b1e1948d5fc..d750a36f4453 100644 --- a/tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs +++ b/tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs @@ -24,5 +24,5 @@ fn main() { .arg(format!("--include-parts-dir={}", parts_out_dir.display())) .arg("--merge=finalize") .run(); - output.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug."); + output.assert_not_ice(); } diff --git a/tests/run-make/rustdoc-test-builder/rmake.rs b/tests/run-make/rustdoc-test-builder/rmake.rs index c243b784eb9b..9aa8143dc1dc 100644 --- a/tests/run-make/rustdoc-test-builder/rmake.rs +++ b/tests/run-make/rustdoc-test-builder/rmake.rs @@ -15,9 +15,8 @@ fn main() { .arg(&absolute_path) .run_fail(); - // We also double-check that we don't have the panic text in the output. + // We check that rustdoc outputs the error correctly... output.assert_stdout_contains("Failed to spawn "); - output.assert_stderr_not_contains("the compiler unexpectedly panicked. this is a bug."); - // Just in case... - output.assert_stdout_not_contains("the compiler unexpectedly panicked. this is a bug."); + // ... and that we didn't panic. + output.assert_not_ice(); }