Soundness with general (non-Copy) elements, and some Copy elements too.
Using uninitialized, you run into the same soundness issues already explored by crates arrayvec and smallvec.
See bugs servo/rust-smallvec/issues/4 and servo/rust-smallvec/issues/5
The second issue is actually an example of soundness issues with a Copy element type (&T).
Another grueling lesson I had to learn: servo/rust-smallvec/pull/15 :-)
thanks for suggestions!!! I prepare a fix in next version :)
btw. I really like how arrayvec is done. :+1: This library was just hacked quickly for my personal project. If I create a pr to arrayvec with decent, structured code implementing extensible array, would you accept it?
Since you ask, no, that's outside of the scope for arrayvec. Isn't that what smallvec covers?
This functionality is often recreated, nothing bad in that, instead it's just a symptom of that: Arrays in rust are not so nice to work with yet (no integer generics), and there is no solution in the libstd. I just wanted to chime in with some tips, I like to help make code safe, so that Rust can be a "safe language" in practice.