Skip to content

Commit 0e071c2

Browse files
committed
Migrate core to Rust 2024
1 parent 590b277 commit 0e071c2

8 files changed

+17
-47
lines changed

library/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ autobenches = false
99
# If you update this, be sure to update it in a bunch of other places too!
1010
# As of 2024, it was src/tools/opt-dist, the core-no-fp-fmt-parse test and
1111
# the version of the prelude imported in core/lib.rs.
12-
edition = "2021"
12+
edition = "2024"
1313

1414
[lib]
1515
test = false

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ extern crate self as core;
226226

227227
#[prelude_import]
228228
#[allow(unused)]
229-
use prelude::rust_2021::*;
229+
use prelude::rust_2024::*;
230230

231231
#[cfg(not(test))] // See #65860
232232
#[macro_use]

tests/mir-opt/gvn_clone.{impl#0}-clone.GVN.diff

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@
5555
bb3: {
5656
StorageDead(_9);
5757
- _0 = AllCopy { a: move _2, b: move _5, c: move _8 };
58+
- StorageDead(_10);
5859
+ _0 = copy (*_1);
60+
+ nop;
5961
StorageDead(_8);
60-
StorageDead(_5);
61-
StorageDead(_2);
62-
- StorageDead(_10);
6362
- StorageDead(_7);
64-
- StorageDead(_4);
65-
+ nop;
6663
+ nop;
64+
StorageDead(_5);
65+
- StorageDead(_4);
6766
+ nop;
67+
StorageDead(_2);
6868
return;
6969
}
7070
}

tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
bb3: {
5454
StorageDead(_9);
5555
_0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
56-
StorageDead(_8);
57-
StorageDead(_5);
58-
StorageDead(_2);
5956
StorageDead(_10);
57+
StorageDead(_8);
6058
StorageDead(_7);
59+
StorageDead(_5);
6160
StorageDead(_4);
61+
StorageDead(_2);
6262
return;
6363
}
6464
}

tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
bb3: {
5454
StorageDead(_9);
5555
_0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
56-
StorageDead(_8);
57-
StorageDead(_5);
58-
StorageDead(_2);
5956
StorageDead(_10);
57+
StorageDead(_8);
6058
StorageDead(_7);
59+
StorageDead(_5);
6160
StorageDead(_4);
61+
StorageDead(_2);
6262
return;
6363
}
6464

tests/run-make/core-no-fp-fmt-parse/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use run_make_support::{rustc, source_root};
55

66
fn main() {
77
rustc()
8-
.edition("2021")
8+
.edition("2024")
99
.arg("-Dwarnings")
1010
.crate_type("rlib")
1111
.input(source_root().join("library/core/src/lib.rs"))

tests/ui/macros/std-2024-macros.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33

44
fn main() {
55
assert_eq!(0, const { 0 });
6-
//~^ ERROR: no rules expected keyword `const`
76
assert_eq!(const { 0 }, const { 0 });
8-
//~^ ERROR: no rules expected keyword `const`
97
assert_eq!(const { 0 }, 0);
10-
//~^ ERROR: no rules expected keyword `const`
118

129
let _: Vec<Vec<String>> = vec![const { vec![] }];
1310
//~^ ERROR: no rules expected keyword `const`
Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,18 @@
11
error: no rules expected keyword `const`
2-
--> $DIR/std-2024-macros.rs:5:19
3-
|
4-
LL | assert_eq!(0, const { 0 });
5-
| ^^^^^ no rules expected this token in macro call
6-
|
7-
note: while trying to match meta-variable `$right:expr`
8-
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
9-
10-
error: no rules expected keyword `const`
11-
--> $DIR/std-2024-macros.rs:7:16
12-
|
13-
LL | assert_eq!(const { 0 }, const { 0 });
14-
| ^^^^^ no rules expected this token in macro call
15-
|
16-
note: while trying to match meta-variable `$left:expr`
17-
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
18-
19-
error: no rules expected keyword `const`
20-
--> $DIR/std-2024-macros.rs:9:16
21-
|
22-
LL | assert_eq!(const { 0 }, 0);
23-
| ^^^^^ no rules expected this token in macro call
24-
|
25-
note: while trying to match meta-variable `$left:expr`
26-
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
27-
28-
error: no rules expected keyword `const`
29-
--> $DIR/std-2024-macros.rs:12:36
2+
--> $DIR/std-2024-macros.rs:9:36
303
|
314
LL | let _: Vec<Vec<String>> = vec![const { vec![] }];
325
| ^^^^^ no rules expected this token in macro call
336
|
347
= note: while trying to match end of macro
358

369
error: no rules expected keyword `const`
37-
--> $DIR/std-2024-macros.rs:14:36
10+
--> $DIR/std-2024-macros.rs:11:36
3811
|
3912
LL | let _: Vec<Vec<String>> = vec![const { vec![] }; 10];
4013
| ^^^^^ no rules expected this token in macro call
4114
|
4215
= note: while trying to match end of macro
4316

44-
error: aborting due to 5 previous errors
17+
error: aborting due to 2 previous errors
4518

0 commit comments

Comments
 (0)