Move Copy and Clone into the list of traits implemented for all sizes
This commit is contained in:
parent
4d247ad7d3
commit
5801109ba9
1 changed files with 3 additions and 6 deletions
|
@ -491,6 +491,8 @@ mod prim_pointer {}
|
||||||
///
|
///
|
||||||
/// Arrays of *any* size implement the following traits if the element type allows it:
|
/// Arrays of *any* size implement the following traits if the element type allows it:
|
||||||
///
|
///
|
||||||
|
/// - [`Copy`]
|
||||||
|
/// - [`Clone`]
|
||||||
/// - [`Debug`]
|
/// - [`Debug`]
|
||||||
/// - [`IntoIterator`] (implemented for `&[T; N]` and `&mut [T; N]`)
|
/// - [`IntoIterator`] (implemented for `&[T; N]` and `&mut [T; N]`)
|
||||||
/// - [`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]
|
/// - [`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]
|
||||||
|
@ -498,15 +500,10 @@ mod prim_pointer {}
|
||||||
/// - [`AsRef`], [`AsMut`]
|
/// - [`AsRef`], [`AsMut`]
|
||||||
/// - [`Borrow`], [`BorrowMut`]
|
/// - [`Borrow`], [`BorrowMut`]
|
||||||
///
|
///
|
||||||
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`] trait
|
/// Arrays of sizes from 0 to 32 (inclusive) implement the [`Default`] trait
|
||||||
/// if the element type allows it. As a stopgap, trait implementations are
|
/// if the element type allows it. As a stopgap, trait implementations are
|
||||||
/// statically generated up to size 32.
|
/// statically generated up to size 32.
|
||||||
///
|
///
|
||||||
/// Arrays of *any* size are [`Copy`] if the element type is [`Copy`]
|
|
||||||
/// and [`Clone`] if the element type is [`Clone`]. This works
|
|
||||||
/// because [`Copy`] and [`Clone`] traits are specially known
|
|
||||||
/// to the compiler.
|
|
||||||
///
|
|
||||||
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
|
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
|
||||||
/// an array. Indeed, this provides most of the API for working with arrays.
|
/// an array. Indeed, this provides most of the API for working with arrays.
|
||||||
/// Slices have a dynamic size and do not coerce to arrays.
|
/// Slices have a dynamic size and do not coerce to arrays.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue