Skip to content

Commit 4aab8e8

Browse files
committed
document panic behavior of Vec::resize and Vec::resize_with
1 parent e643f59 commit 4aab8e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: library/alloc/src/vec/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -2803,6 +2803,10 @@ impl<T, A: Allocator> Vec<T, A> {
28032803
/// want to use the [`Default`] trait to generate values, you can
28042804
/// pass [`Default::default`] as the second argument.
28052805
///
2806+
/// # Panics
2807+
///
2808+
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
2809+
///
28062810
/// # Examples
28072811
///
28082812
/// ```
@@ -3010,6 +3014,10 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
30103014
/// [`Clone`]), use [`Vec::resize_with`].
30113015
/// If you only need to resize to a smaller size, use [`Vec::truncate`].
30123016
///
3017+
/// # Panics
3018+
///
3019+
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
3020+
///
30133021
/// # Examples
30143022
///
30153023
/// ```

0 commit comments

Comments
 (0)