Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit db5c2c6

Browse files
authoredNov 25, 2024
Rollup merge of rust-lang#132982 - suaviloquence:2-doc-changed-alloc-methods, r=Mark-Simulacrum
alloc: fix `Allocator` method names in `alloc` free function docs It looks like these got renamed in rust-lang@9274b37 but the docs never updated. I couldn't find any history for `Allocator::realloc`. The `grow` API is not 1:1 (e.g., it returns a result), so this may not be the correct change - let me know and I can change the method or even remove this entirely.
2 parents 117ad4f + e2aa7c1 commit db5c2c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎alloc/src/alloc.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub use std::alloc::Global;
6161
/// of the allocator registered with the `#[global_allocator]` attribute
6262
/// if there is one, or the `std` crate’s default.
6363
///
64-
/// This function is expected to be deprecated in favor of the `alloc` method
64+
/// This function is expected to be deprecated in favor of the `allocate` method
6565
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
6666
///
6767
/// # Safety
@@ -106,7 +106,7 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
106106
/// of the allocator registered with the `#[global_allocator]` attribute
107107
/// if there is one, or the `std` crate’s default.
108108
///
109-
/// This function is expected to be deprecated in favor of the `dealloc` method
109+
/// This function is expected to be deprecated in favor of the `deallocate` method
110110
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
111111
///
112112
/// # Safety
@@ -125,7 +125,7 @@ pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
125125
/// of the allocator registered with the `#[global_allocator]` attribute
126126
/// if there is one, or the `std` crate’s default.
127127
///
128-
/// This function is expected to be deprecated in favor of the `realloc` method
128+
/// This function is expected to be deprecated in favor of the `grow` and `shrink` methods
129129
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
130130
///
131131
/// # Safety
@@ -145,7 +145,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
145145
/// of the allocator registered with the `#[global_allocator]` attribute
146146
/// if there is one, or the `std` crate’s default.
147147
///
148-
/// This function is expected to be deprecated in favor of the `alloc_zeroed` method
148+
/// This function is expected to be deprecated in favor of the `allocate_zeroed` method
149149
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
150150
///
151151
/// # Safety

0 commit comments

Comments
 (0)
Failed to load comments.