@@ -461,6 +461,10 @@ impl String {
461461 ///
462462 /// [`new`]: String::new
463463 ///
464+ /// # Panics
465+ ///
466+ /// Panics if the new capacity exceeds `isize::MAX` _bytes_.
467+ ///
464468 /// # Examples
465469 ///
466470 /// ```
@@ -1094,6 +1098,10 @@ impl String {
10941098
10951099 /// Appends a given string slice onto the end of this `String`.
10961100 ///
1101+ /// # Panics
1102+ ///
1103+ /// Panics if the new capacity exceeds `isize::MAX` _bytes_.
1104+ ///
10971105 /// # Examples
10981106 ///
10991107 /// ```
@@ -1116,8 +1124,9 @@ impl String {
11161124 ///
11171125 /// # Panics
11181126 ///
1119- /// Panics if the range has `start_bound > end_bound`, or, if the range is
1120- /// bounded on either end and does not lie on a [`char`] boundary.
1127+ /// Panics if the range has `start_bound > end_bound`, if the range is
1128+ /// bounded on either end and does not lie on a [`char`] boundary, or if the
1129+ /// new capacity exceeds `isize::MAX` bytes.
11211130 ///
11221131 /// # Examples
11231132 ///
@@ -1173,7 +1182,7 @@ impl String {
11731182 ///
11741183 /// # Panics
11751184 ///
1176- /// Panics if the new capacity overflows [`usize`] .
1185+ /// Panics if the new capacity exceeds `isize::MAX` _bytes_ .
11771186 ///
11781187 /// # Examples
11791188 ///
@@ -1223,7 +1232,7 @@ impl String {
12231232 ///
12241233 /// # Panics
12251234 ///
1226- /// Panics if the new capacity overflows [`usize`] .
1235+ /// Panics if the new capacity exceeds `isize::MAX` _bytes_ .
12271236 ///
12281237 /// # Examples
12291238 ///
@@ -1387,6 +1396,10 @@ impl String {
13871396
13881397 /// Appends the given [`char`] to the end of this `String`.
13891398 ///
1399+ /// # Panics
1400+ ///
1401+ /// Panics if the new capacity exceeds `isize::MAX` _bytes_.
1402+ ///
13901403 /// # Examples
13911404 ///
13921405 /// ```
0 commit comments