Skip to content

Commit

Permalink
Rollup merge of rust-lang#68711 - hman523:fix-68593, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Added upper bound of what vecs and boxes can allocate

Fixed issue rust-lang#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
  • Loading branch information
Dylan-DPC authored Feb 1, 2020
2 parents ec467a0 + 346920c commit b15b2d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`]:
Expand Down

0 comments on commit b15b2d6

Please sign in to comment.