42 ms·
> The simple answer here is that you cannot make a [T]. That actually makes perfect sense when you consider what that type means. While this is true, I believe
by Jweb_Guru 8y ago
> The simple answer here is that you cannot make a [T]. That actually makes perfect sense when you consider what that type means.
While this is true, I believe there's ongoing work to allow allocating [T] (and other dynamically sized types) on the stack under certain circumstances, using alloca. Which is quite nice since this was an area where Rust lagged behind C.
- PeCaN 8y agoAda can do this conveniently and it can be nice for efficiency and embedded systems (which may not allow heap allocation). It would be nice to see the same feature in Rust.