Editions

The concept of editions was introduced in 2018 to allow stability without stagnation. They provide a way to make changes to the language that would otherwise be backwards incompatible, which would violate Rust's stability guarantees. Editions permit changes to syntax and semantics, but not the standard library of Rust. Because editions are opt-in on a per-crate basis and can interoperate with each other, there is no risk of an ecosystem split.

Current editions
Currently there are two Rust editions:


 * Rust 2015, named after the release year of Rust 1.0, is the default edition, which is used if no edition is specified.
 * Rust 2018 is available since Rust version 1.31. All versions since then support both editions. This means that crates using the 2018 edition can depend on crates using the 2015 edition and vice versa.

Specifying the edition
When using cargo, the edition is specified in the  file with the   key: When invoking   manually, the   option should be used:

Timeline of the 2018 edition
Developing and releasing the 2018 edition involved a lot of planning and work from many parts of the Rust community. Here's a summary of the events:


 * In June 2017, proposing the concept of editions was published.
 * In September 2017, the RFC was accepted.
 * In July 2018, the plans to make a 2018 edition were announced for the first time on the Rust blog.
 * In September, Rust 1.29 was released, which shipped the  command to automatically migrate a project to the 2018 edition.
 * In October, Rust 1.30 was released, which shipped raw identifiers, so newly introduced keywords can be escaped.
 * In November, the redesigned website went online.
 * In December 2018, Rust 1.31, containing the 2018 edition, was released.

What changed with Rust 2018
This is a summary. More information can be found in the edition guide and in the Rust 2018 announcement.

Changes specific to the 2018 edition
The following features were released in Rust 1.31, unless a different version is indicated, and are (or were initially) only available in the 2018 edition:


 * The  and   keywords were reserved
 * the  keyword was reserved and   became a strict keyword.
 * Module paths were reworked, to make them simpler and more intuitive.
 * Anonymous trait parameters were deprecated.
 * Non-lexical lifetimes were introduced to make borrow checking more correct, permissive and provide better error messages.
 * They were backported to the 2015 edition in Rust 1.36.
 * The  operator   (matching at most one item) was added in Rust 1.32
 * It was backported to to the 2015 edition in Rust 1.37.
 * / was stabilized in Rust 1.39.

Other changes associated with Rust 2018
These changes are available in the 2015 edition as well, but were advertised together with the above features, because they were released around the same time:

Language changes

 * Improved lifetime elision
 * Raw identifiers
 * Attribute- and function-like procedural macros
 * applications
 * applications

Tools

 * , Rusts code formatter
 * , Rusts linter

Governance

 * A new edition of the book "The Rust Programming Language" was released
 * The website was redesigned
 * The Domain Working Groups for Network Services, Command-line applications, WebAssembly and Embedded devices were announced

Future editions
Currently there are some ideas what features should be added in the next edition, but there are no concrete plans yet.

The next edition is often referred to as "Rust 2021", although it is unclear if the next edition will be released in 2021.