From 84f584875b0fab8c179865084d14604ee3c63f46 Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Mon, 24 Apr 2023 15:52:57 +0800 Subject: [PATCH] Remove `#[alloc_error_handler]`, fix nightly build See https://github.com/rust-lang/rust/pull/109507 --- src/lib.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e55a2ed..5a29fb8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,6 @@ //! be registered as the standard library’s default allocator. #![no_std] -#![feature(alloc_error_handler)] #[macro_use] extern crate log; @@ -168,16 +167,6 @@ unsafe impl GlobalAlloc for GlobalAllocator { #[cfg_attr(all(target_os = "none", not(test)), global_allocator)] static GLOBAL_ALLOCATOR: GlobalAllocator = GlobalAllocator::new(); -#[cfg(all(target_os = "none", not(test)))] -#[alloc_error_handler] -fn handle_alloc_error(layout: Layout) -> ! { - panic!( - "Heap allocation error: available_bytes = {}, request = {:?}", - global_allocator().available_bytes(), - layout - ); -} - /// Returns the reference to the global allocator. pub fn global_allocator() -> &'static GlobalAllocator { &GLOBAL_ALLOCATOR