Rollup merge of #108630 - overlookmotel:realloc-docs-fix, r=Amanieu

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.
This commit is contained in:
Matthias Krüger 2023-05-27 20:40:27 +02:00 committed by GitHub
commit 1d06bb9612
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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