1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-27 10:13:28 +04:00
rCore/src/lang.rs

21 lines
452 B
Rust
Raw Normal View History

// Rust language features implementions
use core;
2018-04-09 13:02:18 +04:00
use arch::cpu;
#[lang = "eh_personality"]
extern fn eh_personality() {
}
#[lang = "panic_fmt"]
#[no_mangle]
pub extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
2018-05-20 13:14:05 +04:00
error!("\n\nPANIC in {} at line {}:", file, line);
error!(" {}", fmt);
2018-04-09 13:02:18 +04:00
if cfg!(feature = "qemu_auto_exit") {
2018-04-09 17:20:47 +04:00
unsafe{ cpu::exit_in_qemu(3) }
2018-04-09 13:02:18 +04:00
} else {
loop { }
}
}