From b908472a93f218f12d8f980ddf6b008ecee83c87 Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Tue, 25 Apr 2023 00:08:35 +0200 Subject: Revert "Remove #[alloc_error_handler] from the compiler and library" This reverts commit abc0660118cc95f47445fd33502a11dd448f5968. --- example/alloc_example.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'example') diff --git a/example/alloc_example.rs b/example/alloc_example.rs index e39c3272958..4ede2fe4efe 100644 --- a/example/alloc_example.rs +++ b/example/alloc_example.rs @@ -1,4 +1,4 @@ -#![feature(start, core_intrinsics)] +#![feature(start, core_intrinsics, alloc_error_handler)] #![no_std] extern crate alloc; @@ -22,6 +22,11 @@ fn panic_handler(_: &core::panic::PanicInfo) -> ! { core::intrinsics::abort(); } +#[alloc_error_handler] +fn alloc_error_handler(_: alloc::alloc::Layout) -> ! { + core::intrinsics::abort(); +} + #[start] fn main(_argc: isize, _argv: *const *const u8) -> isize { let world: Box<&str> = Box::new("Hello World!\0"); -- cgit 1.4.1-3-g733a5