Skip to content

Commit 5801109

Browse files
committed
Move Copy and Clone into the list of traits implemented for all sizes
1 parent 4d247ad commit 5801109

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

library/std/src/primitive_docs.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -491,22 +491,19 @@ mod prim_pointer {}
491491
///
492492
/// Arrays of *any* size implement the following traits if the element type allows it:
493493
///
494+
/// - [`Copy`]
495+
/// - [`Clone`]
494496
/// - [`Debug`]
495497
/// - [`IntoIterator`] (implemented for `&[T; N]` and `&mut [T; N]`)
496498
/// - [`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]
497499
/// - [`Hash`]
498500
/// - [`AsRef`], [`AsMut`]
499501
/// - [`Borrow`], [`BorrowMut`]
500502
///
501-
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`] trait
503+
/// Arrays of sizes from 0 to 32 (inclusive) implement the [`Default`] trait
502504
/// if the element type allows it. As a stopgap, trait implementations are
503505
/// statically generated up to size 32.
504506
///
505-
/// Arrays of *any* size are [`Copy`] if the element type is [`Copy`]
506-
/// and [`Clone`] if the element type is [`Clone`]. This works
507-
/// because [`Copy`] and [`Clone`] traits are specially known
508-
/// to the compiler.
509-
///
510507
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
511508
/// an array. Indeed, this provides most of the API for working with arrays.
512509
/// Slices have a dynamic size and do not coerce to arrays.

0 commit comments

Comments
 (0)