Skip to content

Commit 2be697f

Browse files
committed
Use global_fn_name instead of format!
1 parent c50427b commit 2be697f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/allocator.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
use gccjit::FnAttribute;
33
use gccjit::{FunctionType, GlobalKind, ToRValue};
44
use rustc_ast::expand::allocator::{
5-
alloc_error_handler_name, default_fn_name, AllocatorKind, AllocatorTy, ALLOCATOR_METHODS,
5+
alloc_error_handler_name, default_fn_name, global_fn_name, AllocatorKind, AllocatorTy,
6+
ALLOCATOR_METHODS,
67
};
78
use rustc_middle::bug;
89
use rustc_middle::ty::TyCtxt;
@@ -46,7 +47,7 @@ pub(crate) unsafe fn codegen(tcx: TyCtxt<'_>, mods: &mut GccContext, _module_nam
4647
panic!("invalid allocator output")
4748
}
4849
};
49-
let name = format!("__rust_{}", method.name);
50+
let name = global_fn_name(method.name);
5051

5152
let args: Vec<_> = types.iter().enumerate()
5253
.map(|(index, typ)| context.new_parameter(None, *typ, &format!("param{}", index)))

0 commit comments

Comments
 (0)