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 😄
This commit is contained in:
commit
b7d05f8165
3 changed files with 3 additions and 3 deletions
|
@ -193,7 +193,7 @@ fn default_hook(info: &PanicInfo<'_>) {
|
||||||
Some(s) => *s,
|
Some(s) => *s,
|
||||||
None => match info.payload().downcast_ref::<String>() {
|
None => match info.payload().downcast_ref::<String>() {
|
||||||
Some(s) => &s[..],
|
Some(s) => &s[..],
|
||||||
None => "Box<Any>",
|
None => "Box<dyn Any>",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let thread = thread_info::current_thread();
|
let thread = thread_info::current_thread();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// run-fail
|
// run-fail
|
||||||
// error-pattern:panicked at 'Box<Any>'
|
// error-pattern:panicked at 'Box<dyn Any>'
|
||||||
// ignore-emscripten no processes
|
// ignore-emscripten no processes
|
||||||
|
|
||||||
#![allow(non_fmt_panic)]
|
#![allow(non_fmt_panic)]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// run-fail
|
// run-fail
|
||||||
// error-pattern:panicked at 'Box<Any>'
|
// error-pattern:panicked at 'Box<dyn Any>'
|
||||||
// ignore-emscripten no processes
|
// ignore-emscripten no processes
|
||||||
|
|
||||||
#![feature(box_syntax)]
|
#![feature(box_syntax)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue