Skip to content

Commit

Permalink
Rollup merge of rust-lang#132982 - suaviloquence:2-doc-changed-alloc-…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
matthiaskrgr authored Nov 25, 2024
2 parents 117ad4f + e2aa7c1 commit db5c2c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub use std::alloc::Global;
/// of the allocator registered with the `#[global_allocator]` attribute
/// if there is one, or the `std` crate’s default.
///
/// This function is expected to be deprecated in favor of the `alloc` method
/// This function is expected to be deprecated in favor of the `allocate` method
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
///
/// # Safety
Expand Down Expand Up @@ -106,7 +106,7 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
/// of the allocator registered with the `#[global_allocator]` attribute
/// if there is one, or the `std` crate’s default.
///
/// This function is expected to be deprecated in favor of the `dealloc` method
/// This function is expected to be deprecated in favor of the `deallocate` method
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
///
/// # Safety
Expand All @@ -125,7 +125,7 @@ pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
/// of the allocator registered with the `#[global_allocator]` attribute
/// if there is one, or the `std` crate’s default.
///
/// This function is expected to be deprecated in favor of the `realloc` method
/// This function is expected to be deprecated in favor of the `grow` and `shrink` methods
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
///
/// # Safety
Expand All @@ -145,7 +145,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
/// of the allocator registered with the `#[global_allocator]` attribute
/// if there is one, or the `std` crate’s default.
///
/// This function is expected to be deprecated in favor of the `alloc_zeroed` method
/// This function is expected to be deprecated in favor of the `allocate_zeroed` method
/// of the [`Global`] type when it and the [`Allocator`] trait become stable.
///
/// # Safety
Expand Down

0 comments on commit db5c2c6

Please sign in to comment.