Skip to content

Commit b7d05f8

Browse files
authoredJun 8, 2021
Rollup merge of #86074 - reaganmcf:iss-86039, r=jyn514
Default panic message should print Box<dyn Any> Closes #86039 Prior to this patch, the panic message from running the following code would be `thread 'main' panicked at 'Box<Any>'...` ```rust use std::panic::panic_any; fn main() { panic_any(42); } ``` This patch updates the phrasing to be more consistent. It now instead shows the following panic message: ``` thread 'main' panicked at 'Box<dyn Any>', ... ``` It's a very small fix 😄
2 parents c302810 + 8330233 commit b7d05f8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎library/std/src/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ fn default_hook(info: &PanicInfo<'_>) {
193193
Some(s) => *s,
194194
None => match info.payload().downcast_ref::<String>() {
195195
Some(s) => &s[..],
196-
None => "Box<Any>",
196+
None => "Box<dyn Any>",
197197
},
198198
};
199199
let thread = thread_info::current_thread();

‎src/test/ui/panics/panic-macro-any-wrapped.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-fail
2-
// error-pattern:panicked at 'Box<Any>'
2+
// error-pattern:panicked at 'Box<dyn Any>'
33
// ignore-emscripten no processes
44

55
#![allow(non_fmt_panic)]

‎src/test/ui/panics/panic-macro-any.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-fail
2-
// error-pattern:panicked at 'Box<Any>'
2+
// error-pattern:panicked at 'Box<dyn Any>'
33
// ignore-emscripten no processes
44

55
#![feature(box_syntax)]

0 commit comments

Comments
 (0)
Please sign in to comment.