6 ms·
When something lands in a particular edition, that’s a minimum edition. So a “Rust 2018 feature” will work in 2018 only, but a “Rust 2015 feature” will work in
by steveklabnik 8y ago
When something lands in a particular edition, that’s a minimum edition. So a “Rust 2018 feature” will work in 2018 only, but a “Rust 2015 feature” will work in both 2015 and 2018. The “frozen” bit means that the features that are specific to Rust 2018 must be set when it is initially released. But new features that aren’t specific to it will still end up being added.
So for example, Rust 1.31 will add the “impl_header_lifetime_elision” feature. It does not require Rust 2018, as it is backwards compatible. As such, it’s a “Rust 2015” feature, but it will work in both.
A feature like async/await requires the async keyword. New keywords are not backwards compatible. As such, it will require Rust 2018, and will not work in 2015. However, if we release “Rust 2021” in three years, it will still work in that.
Does that make sense?
- Dylan16807 8y agoThat makes sense, but I think "feature frozen" is the worst possible term to use here. Only the backwards compatibility gets frozen, not the set of features. And "specific to Rust 2018" is also an awkward term. From context I think that means the set of features that are part of Rust 2018 and also existed on its release day? But that meaning is not obvious. Is there any other term that means "the Rust 2018 set of features, as it was on release day"? It seems like something that really should have a clear name.
- steveklabnik 8y agoYeah, obviously we're struggling here a bit, which means there's some way to get this across better. > From context I think that means the set of features that are part of Rust 2018 and also existed on its release day? The "also existed on its release day" is redundant; they have to be in place on release day. If they weren't, then they'd be breaking.
- Dylan16807 8y ago> So for example, Rust 1.31 will add the “impl_header_lifetime_elision” feature. It does not require Rust 2018, as it is backwards compatible. As such, it’s a “Rust 2015” feature, but it will work in both. > The "also existed on its release day" is redundant; they have to be in place on release day. If they weren't, then they'd be breaking. I don't know how to reconcile these two sentences.
- steveklabnik 8y agoThe former is not about a feature that requires Rust 2018. So the latter does not apply to it at all.
- Dylan16807 8y agoBut just like you can add a "Rust 2015" feature after 2015, you can add a "Rust 2018" feature after 2018, right? If yes, then how do you best distinguish "Rust 2018 with additions" from "Rust 2018, the original 2018 version"? If no, then there are some extremely misleading descriptions of what an 'edition' is, because they don't mention that 2015 is special.
- steveklabnik 8y ago> But just like you can add a "Rust 2015" feature after 2015, you can add a "Rust 2018" feature after 2018, right? You cannot, no. > there are some extremely misleading descriptions of what an 'edition' is Where? I am sorry you're this confused. I don't think I know how to explain this to you.
- Dylan16807 8y agoLet me quote https://blog.rust-lang.org/2018/07/27/what-is-rust-2018.html https://blog.rust-lang.org/2018/07/27/what-is-rust-2018.html "Beyond that, it’s also important to mention that this release will be the initial release of Rust 2018; in some sense, it’s the start, not the end. We haven’t formally committed to a schedule for editions, but it’s likely that the next one will be Rust 2021. We’ll continue to add features to Rust 2018 after its release, just like we continued to add features to Rust after the Rust 1.0 release. "It’s also important to note that Rust 2015 is not frozen. Anything that does not require being a part of Rust 2018 will work on Rust 2015 as well. This is due to the way editions work; given the small nature of possible changes, the compiler uses the same internal representation for all editions." That seems to directly contradict your first answer. Is there some subtlety I'm missing?
- 8y ago