From 8fc7d47c8c43dab634aff15908ab42ca056dda07 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sun, 5 Jul 2020 19:56:41 +0300 Subject: [PATCH] Fix array docs (remove mentions about 0 to 32 where possible) --- src/libstd/primitive_docs.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index e0ceb9f3f3810..86de509e80a10 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -460,8 +460,7 @@ mod prim_pointer {} /// * A repeat expression `[x; N]`, which produces an array with `N` copies of `x`. /// The type of `x` must be [`Copy`][copy]. /// -/// Arrays of sizes from 0 to 32 (inclusive) implement the following traits if -/// the element type allows it: +/// Arrays of *any* size implement the following traits if the element type allows it: /// /// - [`Debug`][debug] /// - [`IntoIterator`][intoiterator] (implemented for `&[T; N]` and `&mut [T; N]`) @@ -469,12 +468,9 @@ mod prim_pointer {} /// - [`Hash`][hash] /// - [`AsRef`][asref], [`AsMut`][asmut] /// - [`Borrow`][borrow], [`BorrowMut`][borrowmut] -/// - [`Default`][default] /// -/// This limitation on the size `N` exists because Rust does not yet support -/// code that is generic over the size of an array type. `[Foo; 3]` and `[Bar; 3]` -/// are instances of same generic type `[T; 3]`, but `[Foo; 3]` and `[Foo; 5]` are -/// entirely different types. As a stopgap, trait implementations are +/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`][default] trait +/// if the element type allows it. As a stopgap, trait implementations are /// statically generated up to size 32. /// /// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy] @@ -521,8 +517,7 @@ mod prim_pointer {} /// for x in array.iter() { } /// ``` /// -/// If the array has 32 or fewer elements (see above), you can also use the -/// array reference's [`IntoIterator`] implementation: +/// You can also use the array reference's [`IntoIterator`] implementation: /// /// ``` /// # let array: [i32; 3] = [0; 3];