11use std:: collections:: hash_map:: Entry :: * ;
22
33use rustc_abi:: { CanonAbi , X86Call } ;
4- use rustc_ast:: expand:: allocator:: {
5- ALLOC_ERROR_HANDLER , ALLOCATOR_METHODS , NO_ALLOC_SHIM_IS_UNSTABLE , global_fn_name,
6- } ;
4+ use rustc_ast:: expand:: allocator:: { AllocatorKind , NO_ALLOC_SHIM_IS_UNSTABLE , global_fn_name} ;
75use rustc_data_structures:: unord:: UnordMap ;
86use rustc_hir:: def:: DefKind ;
97use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LOCAL_CRATE , LocalDefId } ;
@@ -21,6 +19,7 @@ use rustc_target::spec::{Arch, Os, TlsModel};
2119use tracing:: debug;
2220
2321use crate :: back:: symbol_export;
22+ use crate :: base:: allocator_shim_contents;
2423
2524fn threshold ( tcx : TyCtxt < ' _ > ) -> SymbolExportLevel {
2625 crates_export_threshold ( tcx. crate_types ( ) )
@@ -490,14 +489,12 @@ pub(crate) fn provide(providers: &mut Providers) {
490489
491490pub ( crate ) fn allocator_shim_symbols (
492491 tcx : TyCtxt < ' _ > ,
492+ kind : AllocatorKind ,
493493) -> impl Iterator < Item = ( String , SymbolExportKind ) > {
494- ALLOCATOR_METHODS
495- . iter ( )
494+ allocator_shim_contents ( tcx , kind )
495+ . into_iter ( )
496496 . map ( move |method| mangle_internal_symbol ( tcx, global_fn_name ( method. name ) . as_str ( ) ) )
497- . chain ( [
498- mangle_internal_symbol ( tcx, global_fn_name ( ALLOC_ERROR_HANDLER ) . as_str ( ) ) ,
499- mangle_internal_symbol ( tcx, NO_ALLOC_SHIM_IS_UNSTABLE ) ,
500- ] )
497+ . chain ( [ mangle_internal_symbol ( tcx, NO_ALLOC_SHIM_IS_UNSTABLE ) ] )
501498 . map ( move |symbol_name| {
502499 let exported_symbol = ExportedSymbol :: NoDefId ( SymbolName :: new ( tcx, & symbol_name) ) ;
503500
0 commit comments