Skip to content

Commit f48b0e8

Browse files
authored
Merge pull request #338 from ehuss/stabilize-2024
Update for 2024 stabilization
2 parents ff1c198 + 446b495 commit f48b0e8

29 files changed

+15
-118
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
## Rust 2024
4040

41-
- [Rust 2024 🚧](rust-2024/index.md)
41+
- [Rust 2024](rust-2024/index.md)
4242
- [Language](rust-2024/language.md)
4343
- [RPIT lifetime capture rules](rust-2024/rpit-lifetime-capture.md)
4444
- [`if let` temporary scope](rust-2024/temporary-if-let-scope.md)

src/editions/creating-a-new-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ $ cat foo/Cargo.toml
1111
[package]
1212
name = "foo"
1313
version = "0.1.0"
14-
edition = "2021"
14+
edition = "2024"
1515

1616
[dependencies]
1717
```
1818

19-
That `edition = "2021"` setting configures your package to be built using the
20-
Rust 2021 edition. No further configuration needed!
19+
That `edition = "2024"` setting configures your package to be built using the
20+
Rust 2024 edition. No further configuration needed!
2121

2222
You can use the `--edition <YEAR>` option of `cargo new` to create the project
2323
using some specific edition. For example, creating a new project to use the

src/editions/transitioning-an-existing-project-to-a-new-edition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ It will update your source code so that it is compatible with the next edition.
55
Briefly, the steps to update to the next edition are:
66

77
1. Run `cargo fix --edition`
8-
2. Edit `Cargo.toml` and set the `edition` field to the next edition, for example `edition = "2021"`
8+
2. Edit `Cargo.toml` and set the `edition` field to the next edition, for example `edition = "2024"`
99
3. Run `cargo build` or `cargo test` to verify the fixes worked.
1010

1111
The following sections dig into the details of these steps, and some of the issues you may encounter along the way.
@@ -93,7 +93,7 @@ The steps are roughly similar to the stable channel:
9393

9494
1. Install the most recent nightly: `rustup update nightly`.
9595
2. Run `cargo +nightly fix --edition`.
96-
3. Edit `Cargo.toml` and place `cargo-features = ["edition2024"]` at the top (above `[package]`), and change the edition field to say `edition = "2024"`.
96+
3. Edit `Cargo.toml` and place `cargo-features = ["edition20xx"]` at the top (above `[package]`), and change the edition field to say `edition = "20xx"` where `20xx` is the edition you are upgrading to.
9797
4. Run `cargo +nightly check` to verify it now works in the new edition.
9898

9999
> **⚠ Caution**: Features implemented in the next edition may not have automatic migrations implemented with `cargo fix`, and the features themselves may not be finished.

src/rust-2024/cargo-inherited-default-features.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Cargo: Reject unused inherited default-features
22

3-
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
4-
53
## Summary
64

75
- `default-features = false` is no longer allowed in an inherited workspace dependency if the workspace dependency specifies `default-features = true` (or does not specify `default-features`).

src/rust-2024/cargo-resolver.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Cargo: Rust-version aware resolver
22

3-
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
4-
53
## Summary
64

75
- `edition = "2024"` implies `resolver = "3"` in `Cargo.toml` which enables a Rust-version aware dependency resolver.

src/rust-2024/cargo-table-key-names.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Cargo: Table and key name consistency
22

3-
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
4-
53
## Summary
64

75
- Several table and key names in `Cargo.toml` have been removed where there were previously two ways to specify the same thing.

src/rust-2024/gen-keyword.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# `gen` keyword
22

3-
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
4-
More information may be found in the tracking issue at <https://github.com/rust-lang/rust/issues/123904>.
5-
63
## Summary
74

85
- `gen` is a [reserved keyword].

src/rust-2024/index.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
11
# Rust 2024
22

3-
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
4-
53
| Info | |
64
| --- | --- |
75
| RFC | [#3501](https://rust-lang.github.io/rfcs/3501-edition-2024.html) |
8-
| Release version | 1.85.0 (anticipated) |
9-
10-
The Rust 2024 Edition is scheduled to be frozen on 2024-10-17, stabilized on nightly on 2024-11-28, and released as stable with Rust 1.85.0 on 2025-02-20. In more detail, the currently anticipated release schedule is:
11-
12-
| Date | Version | Edition stage |
13-
|------------|---------------|--------------------------------|
14-
| 2024-10-11 | Branch v1.83 | Go / no go on all items |
15-
| 2024-10-17 | Release v1.82 | Rust 2024 nightly beta |
16-
| 2024-11-22 | Branch v1.84 | Prepare to stabilize... |
17-
| 2024-11-28 | Release v1.83 | Stabilize Rust 2024 on master |
18-
| 2025-01-03 | Branch v1.85 | Cut Rust 2024 to beta |
19-
| 2025-01-09 | Release v1.84 | Announce Rust 2024 is pending! |
20-
| 2025-02-20 | Release v1.85 | Release Rust 2024 |
21-
22-
Our motivating priorities for this edition are to:
23-
24-
- Make *this* edition a success.
25-
- Do so without requiring heroics from anyone.
26-
- ...or stressing anyone or everyone out.
27-
28-
Consequently, it's possible that things could change if needed so as to better adhere to those guiding priorities. This is a project run by volunteers.
29-
30-
However, at the moment, **the edition is on track**.
6+
| Release version | 1.85.0 |

src/rust-2024/intoiterator-box-slice.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Add `IntoIterator` for `Box<[T]>`
22

3-
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
4-
More information may be found in the tracking issue at <https://github.com/rust-lang/rust/issues/123759>.
5-
63
## Summary
74

85
- Boxed slices implement [`IntoIterator`] in *all* editions.
@@ -39,8 +36,7 @@ This example is allowed on all editions because previously this was an error sin
3936

4037
However, this would normally be a breaking change because existing code that manually called `.into_iter()` on a boxed slice would change from having an iterator over references to an iterator over values. To resolve this problem, method calls of `.into_iter()` on boxed slices have edition-dependent behavior. In editions before 2024, it continues to return an iterator over references, and starting in Edition 2024 it returns an iterator over values.
4138

42-
<!-- TODO: edition2024 -->
43-
```rust
39+
```rust,edition2024
4440
// Example of changed behavior in Edition 2024
4541
let my_boxed_slice: Box<[u32]> = vec![1, 2, 3].into_boxed_slice();
4642
// Example of old code that still manually calls .into_iter()

src/rust-2024/macro-fragment-specifiers.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Macro Fragment Specifiers
22

3-
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
4-
More information may be found in the tracking issue at <https://github.com/rust-lang/rust/issues/123742>.
5-
63
## Summary
74

85
- The `expr` [fragment specifier] now also supports `const` and `_` expressions.

0 commit comments

Comments
 (0)