diff --git a/rust/kernel/allocator.rs b/rust/kernel/allocator.rs index a942f2a32f9569..759cec47de2b15 100644 --- a/rust/kernel/allocator.rs +++ b/rust/kernel/allocator.rs @@ -27,11 +27,6 @@ unsafe impl GlobalAlloc for KernelAllocator { #[global_allocator] static ALLOCATOR: KernelAllocator = KernelAllocator; -#[alloc_error_handler] -fn oom(_layout: Layout) -> ! { - panic!("Out of memory!"); -} - // `rustc` only generates these for some crate types. Even then, we would need // to extract the object file that has them from the archive. For the moment, // let's generate them ourselves instead. @@ -66,8 +61,3 @@ pub fn __rust_alloc_zeroed(size: usize, _align: usize) -> *mut u8 { ) as *mut u8 } } - -#[no_mangle] -pub fn __rust_alloc_error_handler(_size: usize, _align: usize) -> ! { - panic!("Out of memory!"); -}