about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-05-27 20:40:27 +0200
committerGitHub <noreply@github.com>2023-05-27 20:40:27 +0200
commit1d06bb96129abf007f22c464ddf8808ace178c18 (patch)
treee05257cbfb5a57f0eb7a892f6e6fae6c63b06553
parentf91b634643de14ab5156b0c084d80bd6845fb0ae (diff)
parent48e812687e25955d62b1fb5e19f2f2ae4e728710 (diff)
downloadrust-1d06bb96129abf007f22c464ddf8808ace178c18.tar.gz
rust-1d06bb96129abf007f22c464ddf8808ace178c18.zip
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.
-rw-r--r--library/core/src/alloc/global.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/alloc/global.rs b/library/core/src/alloc/global.rs
index 18da70451f2..c582111701a 100644
--- a/library/core/src/alloc/global.rs
+++ b/library/core/src/alloc/global.rs
@@ -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