about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-08 18:05:29 +0200
committerGitHub <noreply@github.com>2025-04-08 18:05:29 +0200
commit890c6de3104eeaa4e521a4e825f58f61f8146872 (patch)
tree2393a1909f559ada42d75ad83a501d886893cc26
parent7bc1d3abb96820a4e5d199dc72a06a445ed6df3f (diff)
parent4aab8e88e467589e5cf4274c830fd964e30f4166 (diff)
downloadrust-890c6de3104eeaa4e521a4e825f58f61f8146872.tar.gz
rust-890c6de3104eeaa4e521a4e825f58f61f8146872.zip
Rollup merge of #139500 - jogru0:117437, r=tgross35
document panic behavior of Vec::resize and Vec::resize_with

This adds panic documentation to ´Vec::resize´ and ´Vec::resize_with´. Fixes #117437.
-rw-r--r--library/alloc/src/vec/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 633ef717e04..e6867febf6c 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2803,6 +2803,10 @@ impl<T, A: Allocator> Vec<T, A> {
     /// want to use the [`Default`] trait to generate values, you can
     /// pass [`Default::default`] as the second argument.
     ///
+    /// # Panics
+    ///
+    /// Panics if the new capacity exceeds `isize::MAX` _bytes_.
+    ///
     /// # Examples
     ///
     /// ```
@@ -3010,6 +3014,10 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
     /// [`Clone`]), use [`Vec::resize_with`].
     /// If you only need to resize to a smaller size, use [`Vec::truncate`].
     ///
+    /// # Panics
+    ///
+    /// Panics if the new capacity exceeds `isize::MAX` _bytes_.
+    ///
     /// # Examples
     ///
     /// ```