Open
Description
All of the following have where T: Trait
on their impls for [T; 0]
, but don't need it:
- Debug
- Copy
- Clone
- PartialOrd
- Ord
- PartialEq
- Eq
- Hash
A demo of those not in rustdoc:
struct Nothing;
fn must_be_copy<T: Copy>() {}
fn must_be_clone<T: Clone>() {}
pub fn empty_array_is_copy_and_clone() {
must_be_copy::<[Nothing; 0]>();
//^ error: the trait bound `Nothing: std::marker::Copy` is not satisfied in `[Nothing; 0]`
must_be_clone::<[Nothing; 0]>();
//^ error: the trait bound `Nothing: std::clone::Clone` is not satisfied in `[Nothing; 0]`
}
Kudos to whomever did the Default
impls for getting this right: https://doc.rust-lang.org/std/primitive.array.html#impl-Default-29