We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Display
PanicInfo
1 parent 081b5f9 commit 15daf72Copy full SHA for 15daf72
core/src/panic/panic_info.rs
@@ -15,14 +15,10 @@ use crate::panic::Location;
15
/// use std::panic;
16
///
17
/// panic::set_hook(Box::new(|panic_info| {
18
-/// if let Some(s) = panic_info.payload().downcast_ref::<&str>() {
19
-/// println!("panic occurred: {s:?}");
20
-/// } else {
21
-/// println!("panic occurred");
22
-/// }
+/// println!("panic occurred: {panic_info}");
23
/// }));
24
25
-/// panic!("Normal panic");
+/// panic!("critical system failure");
26
/// ```
27
#[lang = "panic_info"]
28
#[stable(feature = "panic_hooks", since = "1.10.0")]
0 commit comments