From f54dbe6e3116a475f63b580884f07474239a0b25 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. --- compiler/rustc_codegen_gcc/example/alloc_example.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_codegen_gcc/example/alloc_example.rs') diff --git a/compiler/rustc_codegen_gcc/example/alloc_example.rs b/compiler/rustc_codegen_gcc/example/alloc_example.rs index faff1dca23f..754e7931412 100644 --- a/compiler/rustc_codegen_gcc/example/alloc_example.rs +++ b/compiler/rustc_codegen_gcc/example/alloc_example.rs @@ -1,4 +1,4 @@ -#![feature(start, core_intrinsics, lang_items)] +#![feature(start, core_intrinsics, alloc_error_handler, lang_items)] #![no_std] extern crate alloc; @@ -21,6 +21,11 @@ fn panic_handler(_: &core::panic::PanicInfo) -> ! { core::intrinsics::abort(); } +#[alloc_error_handler] +fn alloc_error_handler(_: alloc::alloc::Layout) -> ! { + core::intrinsics::abort(); +} + #[lang = "eh_personality"] fn eh_personality() -> ! { loop {} -- cgit 1.4.1-3-g733a5