Function
panic_handler
(panic_info: &core::panic::PanicInfo)
Source from the content-addressed store, hash-verified
| 2 | |
| 3 | #[panic_handler] |
| 4 | fn panic_handler(panic_info: &core::panic::PanicInfo) -> ! { |
| 5 | let err = panic_info.message().unwrap(); |
| 6 | if let Some(location) = panic_info.location() { |
| 7 | println!( |
| 8 | "Panicked at {}:{}, {}", |
| 9 | location.file(), |
| 10 | location.line(), |
| 11 | err |
| 12 | ); |
| 13 | } else { |
| 14 | println!("Panicked: {}", err); |
| 15 | } |
| 16 | kill(getpid() as usize, SignalFlags::SIGABRT.bits()); |
| 17 | unreachable!() |
| 18 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected