Skip to content

Commit

Permalink
Rollup merge of #108630 - overlookmotel:realloc-docs-fix, r=Amanieu
Browse files Browse the repository at this point in the history
Fix docs for `alloc::realloc`

Fixes #108546.

Corrects the docs for `alloc::realloc` to bring the safety constraints into line with `Layout::from_size_align_unchecked`'s constraints.
  • Loading branch information
matthiaskrgr authored May 27, 2023
2 parents f91b634 + 48e8126 commit 1d06bb9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/core/src/alloc/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ pub unsafe trait GlobalAlloc {
/// * `new_size` must be greater than zero.
///
/// * `new_size`, when rounded up to the nearest multiple of `layout.align()`,
/// must not overflow (i.e., the rounded value must be less than `usize::MAX`).
/// must not overflow isize (i.e., the rounded value must be less than or
/// equal to `isize::MAX`).
///
/// (Extension subtraits might provide more specific bounds on
/// behavior, e.g., guarantee a sentinel address or a null pointer
Expand Down

0 comments on commit 1d06bb9

Please sign in to comment.