Skip to content

Commit

Permalink
Default panic message should print Box<dyn Any>
Browse files Browse the repository at this point in the history
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<Any>', ...
```

However, this should be `Box<dyn Any>` instead.
  • Loading branch information
reaganmcf committed Jun 6, 2021
1 parent 6c2dd25 commit eb3fd6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fn default_hook(info: &PanicInfo<'_>) {
Some(s) => *s,
None => match info.payload().downcast_ref::<String>() {
Some(s) => &s[..],
None => "Box<Any>",
None => "Box<dyn Any>",
},
};
let thread = thread_info::current_thread();
Expand Down

0 comments on commit eb3fd6d

Please sign in to comment.