✨ Shiny future story: Barbara implements Default
for all array lengths
Shiny future of status quo story
Barbara is working on std
. She saw that the newest version of rustc has had some improvements to const generics
and decides to try implementing Default
for all array lengths. She goes to write:
The code builds just fine but then she sees a test failing:
"Ah," she says, "I see that Default is implemented for any type [T; 0], regardless of whether T: Default. That makes sense. Argh!"
Next she tries to write:
This compiles just fine and the test is passing. She decides to submit a PR where her reviewer asks her to
add a test to make sure that [T; N]: Default
holds when T: Default
as this didn't used to work
This test passes just fine, "yay const generics ✨" she says