1ea9951b43
Generate better function argument names in global_allocator expansion Generated code for `#[global_allocator] static ALLOCATOR: Allocator = Allocator;`— **Before:** ```rust const _: () = { #[rustc_std_internal_symbol] unsafe fn __rust_alloc(arg0: usize, arg1: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(arg0, arg1), ) } #[rustc_std_internal_symbol] unsafe fn __rust_dealloc(arg0: *mut u8, arg1: usize, arg2: usize) -> () { ::core::alloc::GlobalAlloc::dealloc( &ALLOCATOR, arg0, ::core::alloc::Layout::from_size_align_unchecked(arg1, arg2), ) } #[rustc_std_internal_symbol] unsafe fn __rust_realloc( arg0: *mut u8, arg1: usize, arg2: usize, arg3: usize, ) -> *mut u8 { ::core::alloc::GlobalAlloc::realloc( &ALLOCATOR, arg0, ::core::alloc::Layout::from_size_align_unchecked(arg1, arg2), arg3, ) } #[rustc_std_internal_symbol] unsafe fn __rust_alloc_zeroed(arg0: usize, arg1: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc_zeroed( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(arg0, arg1), ) } }; ``` **After:** ```rust const _: () = { #[rustc_std_internal_symbol] unsafe fn __rust_alloc(size: usize, align: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(size, align), ) } #[rustc_std_internal_symbol] unsafe fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize) -> () { ::core::alloc::GlobalAlloc::dealloc( &ALLOCATOR, ptr, ::core::alloc::Layout::from_size_align_unchecked(size, align), ) } #[rustc_std_internal_symbol] unsafe fn __rust_realloc( ptr: *mut u8, size: usize, align: usize, new_size: usize, ) -> *mut u8 { ::core::alloc::GlobalAlloc::realloc( &ALLOCATOR, ptr, ::core::alloc::Layout::from_size_align_unchecked(size, align), new_size, ) } #[rustc_std_internal_symbol] unsafe fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc_zeroed( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(size, align), ) } }; ``` |
||
---|---|---|
.. | ||
rustc | ||
rustc_abi | ||
rustc_arena | ||
rustc_ast | ||
rustc_ast_lowering | ||
rustc_ast_passes | ||
rustc_ast_pretty | ||
rustc_attr | ||
rustc_baked_icu_data | ||
rustc_borrowck | ||
rustc_builtin_macros | ||
rustc_codegen_cranelift | ||
rustc_codegen_gcc | ||
rustc_codegen_llvm | ||
rustc_codegen_ssa | ||
rustc_const_eval | ||
rustc_data_structures | ||
rustc_driver | ||
rustc_driver_impl | ||
rustc_error_codes | ||
rustc_error_messages | ||
rustc_errors | ||
rustc_expand | ||
rustc_feature | ||
rustc_fluent_macro | ||
rustc_fs_util | ||
rustc_graphviz | ||
rustc_hir | ||
rustc_hir_analysis | ||
rustc_hir_pretty | ||
rustc_hir_typeck | ||
rustc_incremental | ||
rustc_index | ||
rustc_infer | ||
rustc_interface | ||
rustc_lexer | ||
rustc_lint | ||
rustc_lint_defs | ||
rustc_llvm | ||
rustc_log | ||
rustc_macros | ||
rustc_metadata | ||
rustc_middle | ||
rustc_mir_build | ||
rustc_mir_dataflow | ||
rustc_mir_transform | ||
rustc_monomorphize | ||
rustc_parse | ||
rustc_parse_format | ||
rustc_passes | ||
rustc_plugin_impl | ||
rustc_privacy | ||
rustc_query_impl | ||
rustc_query_system | ||
rustc_resolve | ||
rustc_serialize | ||
rustc_session | ||
rustc_smir | ||
rustc_span | ||
rustc_symbol_mangling | ||
rustc_target | ||
rustc_trait_selection | ||
rustc_traits | ||
rustc_transmute | ||
rustc_ty_utils | ||
rustc_type_ir |