mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-23 18:06:24 +04:00
13 lines
366 B
Rust
13 lines
366 B
Rust
use core::panic::PanicInfo;
|
|
use crate::sbi::shutdown;
|
|
|
|
#[panic_handler]
|
|
fn panic(info: &PanicInfo) -> ! {
|
|
if let Some(location) = info.location() {
|
|
println!("[kernel] Panicked at {}:{} {}", location.file(), location.line(), info.message().unwrap());
|
|
} else {
|
|
println!("[kernel] Panicked: {}", info.message().unwrap());
|
|
}
|
|
shutdown()
|
|
}
|