Skip to content

Commit 81411ec

Browse files
committed
feat: Stabilize Edition 2024
1 parent 52c62ee commit 81411ec

File tree

66 files changed

+165
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+165
-259
lines changed

src/cargo/core/features.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ impl Edition {
202202
/// The latest edition that is unstable.
203203
///
204204
/// This is `None` if there is no next unstable edition.
205-
pub const LATEST_UNSTABLE: Option<Edition> = Some(Edition::Edition2024);
205+
pub const LATEST_UNSTABLE: Option<Edition> = None;
206206
/// The latest stable edition.
207-
pub const LATEST_STABLE: Edition = Edition::Edition2021;
207+
pub const LATEST_STABLE: Edition = Edition::Edition2024;
208208
pub const ALL: &'static [Edition] = &[
209209
Self::Edition2015,
210210
Self::Edition2018,
@@ -225,7 +225,7 @@ impl Edition {
225225
Edition2015 => None,
226226
Edition2018 => Some(semver::Version::new(1, 31, 0)),
227227
Edition2021 => Some(semver::Version::new(1, 56, 0)),
228-
Edition2024 => None,
228+
Edition2024 => Some(semver::Version::new(1, 85, 0)),
229229
}
230230
}
231231

@@ -236,7 +236,7 @@ impl Edition {
236236
Edition2015 => true,
237237
Edition2018 => true,
238238
Edition2021 => true,
239-
Edition2024 => false,
239+
Edition2024 => true,
240240
}
241241
}
242242

@@ -509,7 +509,7 @@ features! {
509509
(stable, workspace_inheritance, "1.64", "reference/unstable.html#workspace-inheritance"),
510510

511511
/// Support for 2024 edition.
512-
(unstable, edition2024, "", "reference/unstable.html#edition-2024"),
512+
(stable, edition2024, "1.85", "reference/manifest.html#the-edition-field"),
513513

514514
/// Allow setting trim-paths in a profile to control the sanitisation of file paths in build outputs.
515515
(unstable, trim_paths, "", "reference/unstable.html#profile-trim-paths-option"),

src/cargo/util/toml/embedded.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ autoexamples = false
567567
autolib = false
568568
autotests = false
569569
build = false
570-
edition = "2021"
570+
edition = "2024"
571571
name = "test-"
572572
573573
[profile.release]
@@ -605,7 +605,7 @@ autoexamples = false
605605
autolib = false
606606
autotests = false
607607
build = false
608-
edition = "2021"
608+
edition = "2024"
609609
name = "test-"
610610
611611
[profile.release]

src/cargo/util/toml/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,9 +1217,7 @@ pub fn to_real_manifest(
12171217
// features.require(Feature::edition20xx())?;
12181218
// }
12191219
// ```
1220-
if edition == Edition::Edition2024 {
1221-
features.require(Feature::edition2024())?;
1222-
} else if !edition.is_stable() {
1220+
if !edition.is_stable() {
12231221
// Guard in case someone forgets to add .require()
12241222
return Err(util::errors::internal(format!(
12251223
"edition {} should be gated",

src/doc/man/generated_txt/cargo-init.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OPTIONS
3030
Create a package with a library target (src/lib.rs).
3131

3232
--edition edition
33-
Specify the Rust edition to use. Default is 2021. Possible values:
33+
Specify the Rust edition to use. Default is 2024. Possible values:
3434
2015, 2018, 2021, 2024
3535

3636
--name name

src/doc/man/generated_txt/cargo-new.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ OPTIONS
2525
Create a package with a library target (src/lib.rs).
2626

2727
--edition edition
28-
Specify the Rust edition to use. Default is 2021. Possible values:
28+
Specify the Rust edition to use. Default is 2024. Possible values:
2929
2015, 2018, 2021, 2024
3030

3131
--name name

src/doc/man/includes/options-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Create a package with a library target (`src/lib.rs`).
1010
{{/option}}
1111

1212
{{#option "`--edition` _edition_" }}
13-
Specify the Rust edition to use. Default is 2021.
13+
Specify the Rust edition to use. Default is 2024.
1414
Possible values: 2015, 2018, 2021, 2024
1515
{{/option}}
1616

src/doc/src/commands/cargo-init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This is the default behavior.</dd>
3939

4040

4141
<dt class="option-term" id="option-cargo-init---edition"><a class="option-anchor" href="#option-cargo-init---edition"></a><code>--edition</code> <em>edition</em></dt>
42-
<dd class="option-desc">Specify the Rust edition to use. Default is 2021.
42+
<dd class="option-desc">Specify the Rust edition to use. Default is 2024.
4343
Possible values: 2015, 2018, 2021, 2024</dd>
4444

4545

src/doc/src/commands/cargo-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This is the default behavior.</dd>
3434

3535

3636
<dt class="option-term" id="option-cargo-new---edition"><a class="option-anchor" href="#option-cargo-new---edition"></a><code>--edition</code> <em>edition</em></dt>
37-
<dd class="option-desc">Specify the Rust edition to use. Default is 2021.
37+
<dd class="option-desc">Specify the Rust edition to use. Default is 2024.
3838
Possible values: 2015, 2018, 2021, 2024</dd>
3939

4040

src/doc/src/getting-started/first-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This is all we need to get started. First, let’s check out `Cargo.toml`:
3333
[package]
3434
name = "hello_world"
3535
version = "0.1.0"
36-
edition = "2021"
36+
edition = "2024"
3737

3838
[dependencies]
3939
```

src/doc/src/guide/creating-a-new-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Let’s take a closer look at `Cargo.toml`:
2929
[package]
3030
name = "hello_world"
3131
version = "0.1.0"
32-
edition = "2021"
32+
edition = "2024"
3333

3434
[dependencies]
3535

0 commit comments

Comments
 (0)