Skip to content

Commit f04b2a6

Browse files
authored
rust allocator symbols: add new rustc_std_internal_symbol-s (#3501)
Added a couple of new symbols that new versions of rustc are emitting (#3459). For testing, bumped the test nightly version to a date that includes a compiler that uses them.
1 parent 6a9a016 commit f04b2a6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ffi/rs/allocator_library/allocator_library.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,19 @@ fn __rust_alloc_error_handler(size: usize, align: usize) {
8080
#[rustc_std_internal_symbol]
8181
static mut __rust_alloc_error_handler_should_panic: u8 = 1;
8282

83+
// See https://github.com/rust-lang/rust/pull/143387.
84+
#[linkage = "weak"]
85+
#[rustc_std_internal_symbol]
86+
fn __rust_alloc_error_handler_should_panic_v2() -> u8 {
87+
return 1;
88+
}
89+
8390
// See https://github.com/rust-lang/rust/issues/73632#issuecomment-1563462239
8491
#[linkage = "weak"]
8592
#[rustc_std_internal_symbol]
8693
static mut __rust_no_alloc_shim_is_unstable: u8 = 0;
94+
95+
// See https://github.com/rust-lang/rust/pull/141061.
96+
#[linkage = "weak"]
97+
#[rustc_std_internal_symbol]
98+
fn __rust_no_alloc_shim_is_unstable_v2() {}

test/integration/cc_common_link/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rust.toolchain(
2424
# Generate a toolchain to be used for rust-based allocator symbols.
2525

2626
# A recent enough version of rustc that mangles the internal allocator symbols.
27-
VERSION = "nightly/2025-04-08"
27+
VERSION = "nightly/2025-07-08"
2828

2929
rust.repository_set(
3030
name = "rust_with_alloc_mangling_linux_x86_64",

0 commit comments

Comments
 (0)