1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-23 16:36:18 +04:00
rCore/src/lang.rs

20 lines
437 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-06-01 07:46:32 +04:00
error!("\n\nPANIC in {} at line {}\n {}", file, line, 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 { }
}
}