Chapter 1. What the 2018 Edition of Rust Means to You
Rust version 1.31 introduced a new concept, editions, and specifically added the Rust 2018 Edition. A Rust edition consists of a small number of breaking changes that are opt-in. Let’s explore in more detail what editions are and what they mean to you.
Editions in Rust are a way for the language to evolve without breaking backward compatibility. All editions will be supported in all compiler versions released after each edition is created. Switching to a new edition is always opt-in: if you don’t change the edition
key in your project’s Cargo.toml file, you can upgrade your Rust compiler without breaking your code, according to Rust’s stability guarantees. Because there was no concept of editions when Rust 1.0 released, any Rust project without an edition
key is compiled according to the original Rust syntax. This original syntax is now called Rust 2015 Edition because that’s when Rust 1.0 came out.