Skip to content

Commit 31c9222

Browse files
committed
Stabilize the 2024 edition
1 parent f1e0752 commit 31c9222

File tree

116 files changed

+308
-334
lines changed

Some content is hidden

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

116 files changed

+308
-334
lines changed

compiler/rustc_span/src/edition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub const EDITION_NAME_LIST: &str = "2015|2018|2021|2024";
3333

3434
pub const DEFAULT_EDITION: Edition = Edition::Edition2015;
3535

36-
pub const LATEST_STABLE_EDITION: Edition = Edition::Edition2021;
36+
pub const LATEST_STABLE_EDITION: Edition = Edition::Edition2024;
3737

3838
impl fmt::Display for Edition {
3939
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -62,7 +62,7 @@ impl Edition {
6262
Edition::Edition2015 => true,
6363
Edition::Edition2018 => true,
6464
Edition::Edition2021 => true,
65-
Edition::Edition2024 => false,
65+
Edition::Edition2024 => true,
6666
}
6767
}
6868

src/doc/rustc/src/command-line-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ This informs `rustc` of the name of your crate.
179179
<a id="option-edition"></a>
180180
## `--edition`: specify the edition to use
181181

182-
This flag takes a value of `2015`, `2018` or `2021`. The default is `2015`. More
182+
This flag takes a value of `2015`, `2018`,`2021`, or `2024`. The default is `2015`. More
183183
information about editions may be found in the [edition guide].
184184

185185
[edition guide]: ../edition-guide/introduction.html

src/doc/rustdoc/src/write-documentation/documentation-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ are added.
360360
# fn foo() {}
361361
```
362362

363-
`edition2015`, `edition2018` and `edition2021` tell `rustdoc`
363+
`edition2015`, `edition2018`, `edition2021`, and `edition2024` tell `rustdoc`
364364
that the code sample should be compiled using the respective edition of Rust.
365365

366366
```rust

tests/crashes/124751.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: rust-lang/rust#124751
2-
//@ compile-flags: -Zunstable-options --edition=2024
2+
//@ edition: 2024
33

44
#![feature(gen_blocks)]
55

tests/run-make/rustc-help/help-v.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Options:
2525
--edition 2015|2018|2021|2024
2626
Specify which edition of the compiler to use when
2727
compiling code. The default is 2015 and the latest
28-
stable edition is 2021.
28+
stable edition is 2024.
2929
--emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]
3030
Comma separated list of types of output for the
3131
compiler to emit

tests/run-make/rustc-help/help.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Options:
2525
--edition 2015|2018|2021|2024
2626
Specify which edition of the compiler to use when
2727
compiling code. The default is 2015 and the latest
28-
stable edition is 2021.
28+
stable edition is 2024.
2929
--emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]
3030
Comma separated list of types of output for the
3131
compiler to emit

tests/rustdoc-ui/2024-doctests-checks.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ check-pass
2-
//@ compile-flags: --test --test-args=--test-threads=1 -Zunstable-options --edition 2024
2+
//@ edition: 2024
3+
//@ compile-flags: --test --test-args=--test-threads=1
34
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
45
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
56
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
running 1 test
3-
test $DIR/2024-doctests-checks.rs - Foo (line 7) ... ok
3+
test $DIR/2024-doctests-checks.rs - Foo (line 8) ... ok
44

55
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
66

77

88
running 1 test
9-
test $DIR/2024-doctests-checks.rs - Foo (line 14) ... ok
9+
test $DIR/2024-doctests-checks.rs - Foo (line 15) ... ok
1010

1111
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
1212

tests/rustdoc-ui/2024-doctests-crate-attribute.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ check-pass
2-
//@ compile-flags: --test --test-args=--test-threads=1 -Zunstable-options --edition 2024
2+
//@ edition: 2024
3+
//@ compile-flags: --test --test-args=--test-threads=1
34
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
45
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
56
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
running 1 test
3-
test $DIR/2024-doctests-crate-attribute.rs - Foo (line 19) ... ok
3+
test $DIR/2024-doctests-crate-attribute.rs - Foo (line 20) ... ok
44

55
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
66

77

88
running 1 test
9-
test $DIR/2024-doctests-crate-attribute.rs - Foo (line 10) ... ok
9+
test $DIR/2024-doctests-crate-attribute.rs - Foo (line 11) ... ok
1010

1111
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
1212

0 commit comments

Comments
 (0)