From c99e582c861b65f2cb2a2c585b89ae0e4db2f238 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:26:32 +0200 Subject: [PATCH] Use the default panicking alloc error handler --- src/main.rs | 1 - src/panic.rs | 8 -------- 2 files changed, 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 18f02ae7c9..ccfcf793df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,6 @@ // Ensure that all must_use results are used #![deny(unused_must_use)] -#![feature(alloc_error_handler)] #![feature(allocator_api)] #![feature(asm_const)] // TODO: Relax requirements of most asm invocations #![feature(const_option)] diff --git a/src/panic.rs b/src/panic.rs index e7eb44b488..cbdcb44d19 100644 --- a/src/panic.rs +++ b/src/panic.rs @@ -1,6 +1,5 @@ //! Intrinsics for panic handling -use core::alloc::Layout; use core::panic::PanicInfo; use crate::{cpu_id, context, interrupt, syscall}; @@ -33,10 +32,3 @@ pub extern "C" fn rust_begin_unwind(info: &PanicInfo) -> ! { unsafe { interrupt::halt(); } } } - -#[alloc_error_handler] -#[no_mangle] -#[allow(improper_ctypes_definitions)] // Layout is not repr(C) -pub extern fn rust_oom(_layout: Layout) -> ! { - panic!("kernel memory allocation failed"); -}