Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@ impl String {
///
/// [`new`]: String::new
///
/// # Panics
///
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -1094,6 +1098,10 @@ impl String {

/// Appends a given string slice onto the end of this `String`.
///
/// # Panics
///
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
///
/// # Examples
///
/// ```
Expand All @@ -1116,8 +1124,9 @@ impl String {
///
/// # Panics
///
/// Panics if the range has `start_bound > end_bound`, or, if the range is
/// bounded on either end and does not lie on a [`char`] boundary.
/// Panics if the range has `start_bound > end_bound`, if the range is
/// bounded on either end and does not lie on a [`char`] boundary, or if the
/// new capacity exceeds `isize::MAX` bytes.
///
/// # Examples
///
Expand Down Expand Up @@ -1173,7 +1182,7 @@ impl String {
///
/// # Panics
///
/// Panics if the new capacity overflows [`usize`].
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
///
/// # Examples
///
Expand Down Expand Up @@ -1223,7 +1232,7 @@ impl String {
///
/// # Panics
///
/// Panics if the new capacity overflows [`usize`].
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
///
/// # Examples
///
Expand Down Expand Up @@ -1387,6 +1396,10 @@ impl String {

/// Appends the given [`char`] to the end of this `String`.
///
/// # Panics
///
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
///
/// # Examples
///
/// ```
Expand Down
9 changes: 7 additions & 2 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3292,6 +3292,10 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
/// except that it also works with slice elements that are Clone but not Copy.
/// If Rust gets specialization this function may be deprecated.
///
/// # Panics
///
/// Panics if the new capacity exceeds `isize::MAX` _bytes_.
///
/// # Examples
///
/// ```
Expand All @@ -3313,8 +3317,9 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
///
/// # Panics
///
/// Panics if starting index is greater than the end index
/// or if the index is greater than the length of the vector.
/// Panics if starting index is greater than the end index, if the index is
/// greater than the length of the vector, or if the new capacity exceeds
/// `isize::MAX` _bytes_.
///
/// # Examples
///
Expand Down
Loading