Skip to content

Commit

Permalink
Adapt a use of 'latest edition'
Browse files Browse the repository at this point in the history
  • Loading branch information
muzimuzhi committed Oct 14, 2024
1 parent a942963 commit 9f7b322
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/editions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ However, there are times when it's useful to make backwards-incompatible changes

If Rust had suddenly introduced these new keywords, some code would have broken: `let async = 1;` would no longer work.

Rust uses **editions** to solve this problem. When there are backwards-incompatible changes, they are pushed into the next edition. Since editions are opt-in, existing crates won't use the changes unless they explicitly migrate into the new edition. For example, the latest version of Rust doesn't treat `async` as a keyword unless edition 2018 or later is chosen.
Rust uses **editions** to solve this problem. When there are backwards-incompatible changes, they are pushed into the next edition. Since editions are opt-in, existing crates won't use the changes unless they explicitly migrate into the new edition. For example, the 2015 edition of Rust doesn't treat `async` as a keyword unless edition 2018 or later is chosen.

Each crate chooses its edition [within its `Cargo.toml` file](https://doc.rust-lang.org/cargo/reference/manifest.html#the-edition-field). When creating a new crate with Cargo, it will automatically select the newest stable edition.

Expand Down

0 comments on commit 9f7b322

Please sign in to comment.