Skip to content

Commit 5e561c2

Browse files
authored
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
2 parents 95df2bc + 346920c commit 5e561c2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/liballoc/boxed.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
//!
33
//! [`Box<T>`], casually referred to as a 'box', provides the simplest form of
44
//! heap allocation in Rust. Boxes provide ownership for this allocation, and
5-
//! drop their contents when they go out of scope.
5+
//! drop their contents when they go out of scope. Boxes also ensure that they
6+
//! never allocate more than `isize::MAX` bytes.
67
//!
78
//! # Examples
89
//!

src/liballoc/vec.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//! Vectors have `O(1)` indexing, amortized `O(1)` push (to the end) and
55
//! `O(1)` pop (from the end).
66
//!
7+
//! Vectors ensure they never allocate more than `isize::MAX` bytes.
8+
//!
79
//! # Examples
810
//!
911
//! You can explicitly create a [`Vec<T>`] with [`new`]:

0 commit comments

Comments
 (0)