News for hackers. Stuff that matters.
Re:Methods for Array Initialization in Rust (2018) by qw3rty01 on Monday May 24, 2021 @12:20PM (#27266221)
The case in the article is for when `T: Default`.

The reason this limitation exists is because it was decided that an array length of 0 should impl `Default` even if `T: !Default`, so `impl<T: Default, N: usize> Default for [T; N]` can't be used.

This may be possible in the future if specialization is stabilized, but for now we're stuck with that limit for `Default`.

There are no comments on this comment yet.