2018-10-23 20:05:13 +04:00
|
|
|
// Rust language features implementations
|
2018-04-04 16:56:56 +04:00
|
|
|
|
2018-06-19 19:43:40 +04:00
|
|
|
use core::panic::PanicInfo;
|
2018-08-04 12:20:25 +04:00
|
|
|
use core::alloc::Layout;
|
2018-11-19 13:21:06 +04:00
|
|
|
use log::*;
|
2019-01-08 07:04:39 +04:00
|
|
|
use crate::backtrace;
|
2018-04-04 16:56:56 +04:00
|
|
|
|
|
|
|
#[lang = "eh_personality"]
|
|
|
|
extern fn eh_personality() {
|
|
|
|
}
|
|
|
|
|
2018-09-08 21:25:14 +04:00
|
|
|
#[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);
|
2019-01-08 07:04:39 +04:00
|
|
|
backtrace::backtrace();
|
2018-11-19 13:21:06 +04:00
|
|
|
loop { crate::arch::cpu::halt() }
|
2018-04-09 13:02:18 +04:00
|
|
|
}
|
2018-06-19 19:43:40 +04:00
|
|
|
|
|
|
|
#[lang = "oom"]
|
2018-11-19 13:21:06 +04:00
|
|
|
fn oom(_: Layout) -> ! {
|
2018-06-19 19:43:40 +04:00
|
|
|
panic!("out of memory");
|
|
|
|
}
|