diff options
| author | Jonathan Gruner <jogru0@gmail.com> | 2025-04-08 00:00:38 +0200 |
|---|---|---|
| committer | Jonathan Gruner <jogru0@gmail.com> | 2025-04-08 00:00:38 +0200 |
| commit | 4aab8e88e467589e5cf4274c830fd964e30f4166 (patch) | |
| tree | c90acb80b417be9259ecd3953e6f79079a5e29aa /library/alloc/src | |
| parent | e643f59f6da3a84f43e75dea99afaa5b041ea6bf (diff) | |
| download | rust-4aab8e88e467589e5cf4274c830fd964e30f4166.tar.gz rust-4aab8e88e467589e5cf4274c830fd964e30f4166.zip | |
document panic behavior of Vec::resize and Vec::resize_with
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 8 |
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 /// /// ``` |
