From 42f91047c82c07ab72b9a90bf996c81ef0700888 Mon Sep 17 00:00:00 2001 From: Dexter Chua Date: Wed, 8 Dec 2021 20:00:19 -0500 Subject: [PATCH] Fix `Vec::reserve_exact` documentation The documentation previously said the new capacity cannot overflow `usize`, but in fact it cannot exceed `isize::MAX`. --- library/alloc/src/vec/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index f1b70fa280214..f65764770b1ab 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -822,7 +822,7 @@ impl Vec { /// /// # Panics /// - /// Panics if the new capacity overflows `usize`. + /// Panics if the new capacity exceeds `isize::MAX` bytes. /// /// # Examples ///