1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-26 18:03:27 +04:00
rCore/kernel/src/lang.rs

23 lines
411 B
Rust
Raw Normal View History

// Rust language features implementations
use core::panic::PanicInfo;
use core::alloc::Layout;
2018-11-19 13:21:06 +04:00
use log::*;
use crate::backtrace;
#[lang = "eh_personality"]
extern fn eh_personality() {
}
#[panic_handler]
2018-11-19 13:21:06 +04:00
fn panic(info: &PanicInfo) -> ! {
2019-03-17 20:18:03 +04:00
error!("\n\n{}", info);
backtrace::backtrace();
2018-11-19 13:21:06 +04:00
loop { crate::arch::cpu::halt() }
2018-04-09 13:02:18 +04:00
}
#[lang = "oom"]
2018-11-19 13:21:06 +04:00
fn oom(_: Layout) -> ! {
panic!("out of memory");
}