From 6886c340957099c1a12f102bc2ccbc24bdc52716 Mon Sep 17 00:00:00 2001 From: LN Liberda Date: Wed, 1 Oct 2025 00:11:26 +0200 Subject: [PATCH] Revert "[rust] Remove the old __rust_alloc_error_handler_should_panic symbol" Needed for building with Rust <1.90 This reverts commit e33287758f2234d6aabfc5d4e011c4e81e3a47cf. --- build/rust/allocator/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/rust/allocator/lib.rs b/build/rust/allocator/lib.rs index b92aec8086f3f..a7fa7a470f000 100644 --- a/build/rust/allocator/lib.rs +++ b/build/rust/allocator/lib.rs @@ -96,6 +96,13 @@ mod both_allocators { 0 } + // Mangle the symbol name as rustc expects. + // TODO(crbug.com/440481922): Remove this after rolling past https://github.com/rust-lang/rust/pull/143387 + #[rustc_std_internal_symbol] + #[allow(non_upper_case_globals)] + #[linkage = "weak"] + static __rust_alloc_error_handler_should_panic: u8 = 0; + // Mangle the symbol name as rustc expects. #[rustc_std_internal_symbol] #[allow(non_upper_case_globals)]