Skip to content

Commit 8fc7d47

Browse files
committed
Fix array docs (remove mentions about 0 to 32 where possible)
1 parent 44dd95e commit 8fc7d47

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/libstd/primitive_docs.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -460,21 +460,17 @@ mod prim_pointer {}
460460
/// * A repeat expression `[x; N]`, which produces an array with `N` copies of `x`.
461461
/// The type of `x` must be [`Copy`][copy].
462462
///
463-
/// Arrays of sizes from 0 to 32 (inclusive) implement the following traits if
464-
/// the element type allows it:
463+
/// Arrays of *any* size implement the following traits if the element type allows it:
465464
///
466465
/// - [`Debug`][debug]
467466
/// - [`IntoIterator`][intoiterator] (implemented for `&[T; N]` and `&mut [T; N]`)
468467
/// - [`PartialEq`][partialeq], [`PartialOrd`][partialord], [`Eq`][eq], [`Ord`][ord]
469468
/// - [`Hash`][hash]
470469
/// - [`AsRef`][asref], [`AsMut`][asmut]
471470
/// - [`Borrow`][borrow], [`BorrowMut`][borrowmut]
472-
/// - [`Default`][default]
473471
///
474-
/// This limitation on the size `N` exists because Rust does not yet support
475-
/// code that is generic over the size of an array type. `[Foo; 3]` and `[Bar; 3]`
476-
/// are instances of same generic type `[T; 3]`, but `[Foo; 3]` and `[Foo; 5]` are
477-
/// entirely different types. As a stopgap, trait implementations are
472+
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`][default] trait
473+
/// if the element type allows it. As a stopgap, trait implementations are
478474
/// statically generated up to size 32.
479475
///
480476
/// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy]
@@ -521,8 +517,7 @@ mod prim_pointer {}
521517
/// for x in array.iter() { }
522518
/// ```
523519
///
524-
/// If the array has 32 or fewer elements (see above), you can also use the
525-
/// array reference's [`IntoIterator`] implementation:
520+
/// You can also use the array reference's [`IntoIterator`] implementation:
526521
///
527522
/// ```
528523
/// # let array: [i32; 3] = [0; 3];

0 commit comments

Comments
 (0)