Downcast panic payload to String too in example. · model-checking/verify-rust-std@518722e (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 518722e

Downcast panic payload to String too in example.

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 2 additions & 0 deletions

Original file line number Diff line number Diff line change
@@ -73,6 +73,8 @@ impl<'a> PanicHookInfo<'a> {
73 73 /// panic::set_hook(Box::new(|panic_info
74 74 /// if let Some(s) = panic_info.payload().downcast_ref::<&str>() {
75 75 /// println!("panic occurred: {s:?}");
76 + /// } else if let Some(s) = panic_info.payload().downcast_ref::() {
77 + /// println!("panic occurred: {s:?}");
76 78 /// } else {
77 79 /// println!("panic occurred");
78 80 /// }