about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-03 18:58:27 +0100
committerGitHub <noreply@github.com>2020-02-03 18:58:27 +0100
commit5e561c213537f9f44c0c0c7fb4fba9263b551dc1 (patch)
tree2c355a921bb11c3cc54a3016fe5ea6b4cadacb78 /src/liballoc
parent95df2bcaeb0af12ef0b4b4b547d1eef445af7c68 (diff)
parent346920c3c844e650aff6428c6b5c6e70cbce9954 (diff)
downloadrust-5e561c213537f9f44c0c0c7fb4fba9263b551dc1.tar.gz
rust-5e561c213537f9f44c0c0c7fb4fba9263b551dc1.zip
Rollup merge of #68711 - hman523:fix-68593, r=Dylan-DPC
Added upper bound of what vecs and boxes can allocate

Fixed issue #68593
I added a line of documentation to these two files to reflect that vectors and boxes ensure that they never allocate more than `isize::MAX` bytes.
r? @steveklabnik
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/boxed.rs3
-rw-r--r--src/liballoc/vec.rs2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 8735c2c8f36..7e5efbe3078 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -2,7 +2,8 @@
 //!
 //! [`Box<T>`], casually referred to as a 'box', provides the simplest form of
 //! heap allocation in Rust. Boxes provide ownership for this allocation, and
-//! drop their contents when they go out of scope.
+//! drop their contents when they go out of scope. Boxes also ensure that they
+//! never allocate more than `isize::MAX` bytes.
 //!
 //! # Examples
 //!
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index 26a7812f58e..4f6b7870e2e 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -4,6 +4,8 @@
 //! Vectors have `O(1)` indexing, amortized `O(1)` push (to the end) and
 //! `O(1)` pop (from the end).
 //!
+//! Vectors ensure they never allocate more than `isize::MAX` bytes.
+//!
 //! # Examples
 //!
 //! You can explicitly create a [`Vec<T>`] with [`new`]: