What are Editions?
Rust ships releases on a six-week cycle. This means that users get a constantstream of new features. This is much faster than updates for other languages,but this also means that each update is smaller. After a while, all of thosetiny changes add up. But, from release to release, it can be hard to look backand say "Wow, between Rust 1.10 and Rust 1.20, Rust has changed a lot!"
Every two or three years, we'll be producing a new edition of Rust. Eachedition brings together the features that have landed into a clear package, withfully updated documentation and tooling. New editions ship through the usualrelease process.
This serves different purposes for different people:
For active Rust users, it brings together incremental changes into aneasy-to-understand package.
For non-users, it signals that some major advancements have landed, whichmight make Rust worth another look.
For those developing Rust itself, it provides a rallying point for the project as awhole.
Compatibility
When a new edition becomes available in the compiler, crates must explicitly optin to it to take full advantage. This opt in enables editions to containincompatible changes, like adding a new keyword that might conflict withidentifiers in code, or turning warnings into errors. A Rust compiler willsupport all editions that existed prior to the compiler's release, and can linkcrates of any supported editions together.Edition changes only affect the way the compiler initially parses the code.Therefore, if you're using Rust 2015, andone of your dependencies uses Rust 2018, it all works just fine. The oppositesituation works as well.
Just to be clear: most features will be available on all editions.People using any edition of Rust will continue to see improvements as newstable releases are made. In some cases however, mainly when new keywords areadded, but sometimes for other reasons, there may be new features that are onlyavailable in later editions. You only need to upgrade if you want to takeadvantage of such features.