From eb3fd6d208da80147430fea4be740acea687d8aa Mon Sep 17 00:00:00 2001 From: Reagan McFarland Date: Sun, 6 Jun 2021 16:21:47 -0400 Subject: [PATCH 1/2] Default panic message should print Box Prior to this patch, the default panic message (resulting from calling `panic_any(42);` for example), would print the following error message: ``` thread 'main' panicked at 'Box', ... ``` However, this should be `Box` instead. --- library/std/src/panicking.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 02957e75a7409..e591e073e7bbb 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -193,7 +193,7 @@ fn default_hook(info: &PanicInfo<'_>) { Some(s) => *s, None => match info.payload().downcast_ref::() { Some(s) => &s[..], - None => "Box", + None => "Box", }, }; let thread = thread_info::current_thread(); From 8330233ba751778f8571c8879f85612fd2d9fb9a Mon Sep 17 00:00:00 2001 From: Reagan McFarland Date: Sun, 6 Jun 2021 19:38:53 -0400 Subject: [PATCH 2/2] Update testsuite to match new panic msg This patch fixes tests from failing that were matching on `Box`, which was the old panic message. Since the new panic message is `Box`, the tests have been updated to match against this instead. --- src/test/ui/panics/panic-macro-any-wrapped.rs | 2 +- src/test/ui/panics/panic-macro-any.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/panics/panic-macro-any-wrapped.rs b/src/test/ui/panics/panic-macro-any-wrapped.rs index 95ae6ffe8be02..100ac10c76717 100644 --- a/src/test/ui/panics/panic-macro-any-wrapped.rs +++ b/src/test/ui/panics/panic-macro-any-wrapped.rs @@ -1,5 +1,5 @@ // run-fail -// error-pattern:panicked at 'Box' +// error-pattern:panicked at 'Box' // ignore-emscripten no processes #![allow(non_fmt_panic)] diff --git a/src/test/ui/panics/panic-macro-any.rs b/src/test/ui/panics/panic-macro-any.rs index d2a7ba3713a51..a5ba30220e89a 100644 --- a/src/test/ui/panics/panic-macro-any.rs +++ b/src/test/ui/panics/panic-macro-any.rs @@ -1,5 +1,5 @@ // run-fail -// error-pattern:panicked at 'Box' +// error-pattern:panicked at 'Box' // ignore-emscripten no processes #![feature(box_syntax)]