Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The tracking issue for const generics is here: https://github.com/rust-lang/rust/issues/44580


As far I understand the RFC won't allow for `Array[Y, N]` (or `Array<T, N>` in Rust parlance) note eddyb's comment:

     Note that all of this should allow impl<T, const N: usize> Trait for [T; N] {...}, 
     but not actually passing a constant expression to a type/function, e.g. ArrayVec<T, 3>.
What I'm actually looking is `Array<Y, size_of::<T>>` for support for data structures that vary depending on size of `T`.


The RFC supports it, eddyb's list of milestones in the compiler just don't get you all the way there.


One of the biggest issues with looking at tracking issues for me is that it's impossible to judge either priority or complexity. This one for instance is a good one. Tags say implemented and approved, the checklist is mostly docs. Yet it looks like from the discussion that this issue is closer to not landing at all in this form than landing.


As with many large features, people with their heads down will be working on it for a long time without much fanfare, until suddenly the feature appears in a mostly-usable state shortly before it is able to be stabilized. Not much solace for the people who want to be able to predict when features will land, though the tracking issue should at least give some idea as to which developers are prioritizing this so that one can contact them directly for more information.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: