Re:GCC Rust: GCC Front-End for Rust
by CodesInChaos on Monday January 11, 2021 @11:26AM
(#25731136)
Doesn't min_const_generics (stable once 1.51 releases on 2021-03-25) cover everything std needs (implementing traits for arbitrary array sizes)?
Re:GCC Rust: GCC Front-End for Rust
by steveklabnik on Monday January 11, 2021 @11:35AM
(#25731322)
I believe that it does, yes. We haven't hit that in stable yet, though, so I am speaking purely in the present. You're right that it's looking good for stabilization in a few months, but anything can happen, in theory. I'm more trying to illustrate the point, that significant features can depend on something that's unstable currently. Those impls landed well before it was even marked as being stable in nightly.
It might. There are at least two major things off the top of my head, regarding libstd:
1. specialization is needed for performance around String and &str
2. const generics are needed to support some trait implementations
We currently allow some stuff like this to leak through, in a sense, when we're sure that we're actually going to be making things stable someday. An alternative compiler could patch out 1, and accept slower code, but 2 would require way more effort.
There has been some discussion about trying to remove unstable features from the compiler itself, specifically to make it easier to contribute to, but it unlikely that it will be completely removed from the current implementation of libstd for some time.