From 346920c3c844e650aff6428c6b5c6e70cbce9954 Mon Sep 17 00:00:00 2001 From: hman523 Date: Fri, 31 Jan 2020 13:41:07 -0600 Subject: [PATCH] Fixed issue 68593 --- src/liballoc/boxed.rs | 3 ++- src/liballoc/vec.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 8735c2c8f3625..7e5efbe307861 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -2,7 +2,8 @@ //! //! [`Box`], 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 26a7812f58e01..4f6b7870e2e8c 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`] with [`new`]: