Skip to content

Commit

Permalink
Merge pull request #266 from ehuss/2021-stabilization
Browse files Browse the repository at this point in the history
Update for 2021 stabilization
  • Loading branch information
m-ou-se authored Aug 31, 2021
2 parents 3710b0c + 09a02b0 commit 2d9b1b9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

## Rust 2021

- [Rust 2021 🚧](rust-2021/index.md)
- [Rust 2021](rust-2021/index.md)
- [Additions to the prelude](rust-2021/prelude.md)
- [Default Cargo feature resolver](rust-2021/default-cargo-resolver.md)
- [IntoIterator for arrays](rust-2021/IntoIterator-for-arrays.md)
Expand Down
8 changes: 3 additions & 5 deletions src/editions/creating-a-new-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ configuration for the latest edition:
```console
> cargo +nightly new foo
Created binary (application) `foo` project
> cat .\foo\Cargo.toml
> cat foo/Cargo.toml
[package]
name = "foo"
version = "0.1.0"
authors = ["your name <[email protected]>"]
edition = "2018"
edition = "2021"

[dependencies]
```

That `edition = "2018"` setting will configure your package to use Rust 2018.
That `edition = "2021"` setting will configure your package to use Rust 2021.
No more configuration needed!

If you'd prefer to use an older edition, you can change the value in that
Expand All @@ -26,7 +25,6 @@ key, for example:
[package]
name = "foo"
version = "0.1.0"
authors = ["your name <[email protected]>"]
edition = "2015"

[dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ Briefly, the steps to update to the next edition are:
2. Edit `Cargo.toml` and set the `edition` field to the next edition, for example `edition = "2021"`
3. Run `cargo build` or `cargo test` to verify the fixes worked.

<!-- remove this when 2021 is stabilized -->
> If you are migrating from 2018 to 2021, the steps are slightly different because 2021 is not yet stabilized, and is only available on the [nightly channel].
> The steps to follow are:
>
> 1. Install the most recent nightly: `rustup update nightly`.
> 2. Run `cargo +nightly fix --edition`.
> 3. Edit `Cargo.toml` and place `cargo-features = ["edition2021"]` at the top (above `[package]`), and change the edition field to say `edition = "2021"`.
> 4. Run `cargo +nightly check` to verify it now works in the new edition.
The following sections dig into the details of these steps, and some of the issues you may encounter along the way.

> It's our intention that the migration to new editions is as smooth an
Expand Down
21 changes: 5 additions & 16 deletions src/rust-2021/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# Rust 2021

🚧 The 2021 Edition has not yet been released and hence this section is still "under construction".
You can [read more about our plans in this blog post](https://blog.rust-lang.org/2021/05/11/edition-2021.html).

| Info | |
| --- | --- |
| RFC | [#3085](https://github.com/rust-lang/rfcs/pull/3085) |
| Release version | 1.56.0 (anticipated) |

The Rust 2021 Edition is currently slated for release in Rust 1.56.0.
Rust 1.56.0 will then be in beta for six weeks,
after which it is released as stable on October 21st.

However, note that Rust is a project run by volunteers.
We prioritize the personal well-being of everyone working on Rust
over any deadlines and expectations we might have set.
This could mean delaying the edition a version if necessary,
or dropping a feature that turns out to be too difficult or stressful to finish in time.
| Release version | 1.56.0 |

That said, we are on schedule and many of the difficult problems are already tackled,
thanks to all the people contributing to Rust 2021! 💛
The Rust 2021 Edition contains several changes that bring new capabilities and more consistency to the language,
and opens up room for expansion in the future.
The following chapters dive into the details of each change,
and they include guidance on migrating your existing code.

0 comments on commit 2d9b1b9

Please sign in to comment.