about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-07-06 18:56:01 +0200
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-05-11 14:35:09 +0000
commit2be697f60d53fe321a74fb99d3cde452a94eb3da (patch)
tree980e38830ffe6642d999b6b03c94ee9045f0a4b4 /src
parentc50427ba86aadcbec86bf9b35f0c32ee818c7705 (diff)
downloadrust-2be697f60d53fe321a74fb99d3cde452a94eb3da.tar.gz
rust-2be697f60d53fe321a74fb99d3cde452a94eb3da.zip
Use global_fn_name instead of format!
Diffstat (limited to 'src')
-rw-r--r--src/allocator.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/allocator.rs b/src/allocator.rs
index fe143aaad5f..ff68de8c8f1 100644
--- a/src/allocator.rs
+++ b/src/allocator.rs
@@ -2,7 +2,8 @@
 use gccjit::FnAttribute;
 use gccjit::{FunctionType, GlobalKind, ToRValue};
 use rustc_ast::expand::allocator::{
-    alloc_error_handler_name, default_fn_name, AllocatorKind, AllocatorTy, ALLOCATOR_METHODS,
+    alloc_error_handler_name, default_fn_name, global_fn_name, AllocatorKind, AllocatorTy,
+    ALLOCATOR_METHODS,
 };
 use rustc_middle::bug;
 use rustc_middle::ty::TyCtxt;
@@ -46,7 +47,7 @@ pub(crate) unsafe fn codegen(tcx: TyCtxt<'_>, mods: &mut GccContext, _module_nam
                     panic!("invalid allocator output")
                 }
             };
-            let name = format!("__rust_{}", method.name);
+            let name = global_fn_name(method.name);
 
             let args: Vec<_> = types.iter().enumerate()
                 .map(|(index, typ)| context.new_parameter(None, *typ, &format!("param{}", index)))