We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Display
PanicInfo
1 parent 709a97f commit d9f99c3Copy full SHA for d9f99c3
library/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