diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 84c6df5c7446..f283a625f977 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2567,6 +2567,11 @@ impl<'test> TestCx<'test> { }) .into_owned(); + // Normalize thread IDs in panic messages + normalized = static_regex!(r"thread '(?P.*?)' \((rtid )?\d+\) panicked") + .replace_all(&normalized, "thread '$name' ($$TID) panicked") + .into_owned(); + normalized = normalized.replace("\t", "\\t"); // makes tabs visible // Remove test annotations like `//~ ERROR text` from the output, diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 73fbe2cc020f..f021d5194cd9 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -248,7 +248,8 @@ regexes! { // erase alloc ids "alloc[0-9]+" => "ALLOC", // erase thread ids - r"unnamed-[0-9]+" => "unnamed-ID", + r"unnamed-[0-9]+" => "unnamed-ID", + r"thread '(?P.*?)' \(\d+\) panicked" => "thread '$name' ($$TID) panicked", // erase borrow tags "<[0-9]+>" => "", "<[0-9]+=" => "