File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -353,8 +353,9 @@ impl<T: Ord, const N: usize> Ord for [T; N] {
353
353
}
354
354
}
355
355
356
- // The Default impls cannot be generated using the array_impls! macro because
357
- // they require array literals.
356
+ // The Default impls cannot be done with const generics because `[T; 0]` doesn't
357
+ // require Default to be implemented, and having different impl blocks for
358
+ // different numbers isn't supported yet.
358
359
359
360
macro_rules! array_impl_default {
360
361
{ $n: expr, $t: ident $( $ts: ident) * } => {
Original file line number Diff line number Diff line change @@ -491,22 +491,19 @@ mod prim_pointer {}
491
491
///
492
492
/// Arrays of *any* size implement the following traits if the element type allows it:
493
493
///
494
+ /// - [`Copy`]
495
+ /// - [`Clone`]
494
496
/// - [`Debug`]
495
497
/// - [`IntoIterator`] (implemented for `&[T; N]` and `&mut [T; N]`)
496
498
/// - [`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]
497
499
/// - [`Hash`]
498
500
/// - [`AsRef`], [`AsMut`]
499
501
/// - [`Borrow`], [`BorrowMut`]
500
502
///
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
502
504
/// if the element type allows it. As a stopgap, trait implementations are
503
505
/// statically generated up to size 32.
504
506
///
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
- ///
510
507
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
511
508
/// an array. Indeed, this provides most of the API for working with arrays.
512
509
/// Slices have a dynamic size and do not coerce to arrays.
You can’t perform that action at this time.
0 commit comments