Migrate core to Rust 2024

This commit is contained in:
Eric Huss 2025-02-11 14:25:26 -08:00
parent 590b277d25
commit 0e071c2c6a
8 changed files with 18 additions and 48 deletions

View file

@ -9,7 +9,7 @@ autobenches = false
# If you update this, be sure to update it in a bunch of other places too! # If you update this, be sure to update it in a bunch of other places too!
# As of 2024, it was src/tools/opt-dist, the core-no-fp-fmt-parse test and # As of 2024, it was src/tools/opt-dist, the core-no-fp-fmt-parse test and
# the version of the prelude imported in core/lib.rs. # the version of the prelude imported in core/lib.rs.
edition = "2021" edition = "2024"
[lib] [lib]
test = false test = false

View file

@ -226,7 +226,7 @@ extern crate self as core;
#[prelude_import] #[prelude_import]
#[allow(unused)] #[allow(unused)]
use prelude::rust_2021::*; use prelude::rust_2024::*;
#[cfg(not(test))] // See #65860 #[cfg(not(test))] // See #65860
#[macro_use] #[macro_use]

View file

@ -55,16 +55,16 @@
bb3: { bb3: {
StorageDead(_9); StorageDead(_9);
- _0 = AllCopy { a: move _2, b: move _5, c: move _8 }; - _0 = AllCopy { a: move _2, b: move _5, c: move _8 };
+ _0 = copy (*_1);
StorageDead(_8);
StorageDead(_5);
StorageDead(_2);
- StorageDead(_10); - StorageDead(_10);
+ _0 = copy (*_1);
+ nop;
StorageDead(_8);
- StorageDead(_7); - StorageDead(_7);
+ nop;
StorageDead(_5);
- StorageDead(_4); - StorageDead(_4);
+ nop; + nop;
+ nop; StorageDead(_2);
+ nop;
return; return;
} }
} }

View file

@ -53,12 +53,12 @@
bb3: { bb3: {
StorageDead(_9); StorageDead(_9);
_0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 }; _0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
StorageDead(_8);
StorageDead(_5);
StorageDead(_2);
StorageDead(_10); StorageDead(_10);
StorageDead(_8);
StorageDead(_7); StorageDead(_7);
StorageDead(_5);
StorageDead(_4); StorageDead(_4);
StorageDead(_2);
return; return;
} }
} }

View file

@ -53,12 +53,12 @@
bb3: { bb3: {
StorageDead(_9); StorageDead(_9);
_0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 }; _0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
StorageDead(_8);
StorageDead(_5);
StorageDead(_2);
StorageDead(_10); StorageDead(_10);
StorageDead(_8);
StorageDead(_7); StorageDead(_7);
StorageDead(_5);
StorageDead(_4); StorageDead(_4);
StorageDead(_2);
return; return;
} }

View file

@ -5,7 +5,7 @@ use run_make_support::{rustc, source_root};
fn main() { fn main() {
rustc() rustc()
.edition("2021") .edition("2024")
.arg("-Dwarnings") .arg("-Dwarnings")
.crate_type("rlib") .crate_type("rlib")
.input(source_root().join("library/core/src/lib.rs")) .input(source_root().join("library/core/src/lib.rs"))

View file

@ -3,11 +3,8 @@
fn main() { fn main() {
assert_eq!(0, const { 0 }); assert_eq!(0, const { 0 });
//~^ ERROR: no rules expected keyword `const`
assert_eq!(const { 0 }, const { 0 }); assert_eq!(const { 0 }, const { 0 });
//~^ ERROR: no rules expected keyword `const`
assert_eq!(const { 0 }, 0); assert_eq!(const { 0 }, 0);
//~^ ERROR: no rules expected keyword `const`
let _: Vec<Vec<String>> = vec![const { vec![] }]; let _: Vec<Vec<String>> = vec![const { vec![] }];
//~^ ERROR: no rules expected keyword `const` //~^ ERROR: no rules expected keyword `const`

View file

@ -1,32 +1,5 @@
error: no rules expected keyword `const` error: no rules expected keyword `const`
--> $DIR/std-2024-macros.rs:5:19 --> $DIR/std-2024-macros.rs:9:36
|
LL | assert_eq!(0, const { 0 });
| ^^^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$right:expr`
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
error: no rules expected keyword `const`
--> $DIR/std-2024-macros.rs:7:16
|
LL | assert_eq!(const { 0 }, const { 0 });
| ^^^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$left:expr`
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
error: no rules expected keyword `const`
--> $DIR/std-2024-macros.rs:9:16
|
LL | assert_eq!(const { 0 }, 0);
| ^^^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$left:expr`
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
error: no rules expected keyword `const`
--> $DIR/std-2024-macros.rs:12:36
| |
LL | let _: Vec<Vec<String>> = vec![const { vec![] }]; LL | let _: Vec<Vec<String>> = vec![const { vec![] }];
| ^^^^^ no rules expected this token in macro call | ^^^^^ no rules expected this token in macro call
@ -34,12 +7,12 @@ LL | let _: Vec<Vec<String>> = vec![const { vec![] }];
= note: while trying to match end of macro = note: while trying to match end of macro
error: no rules expected keyword `const` error: no rules expected keyword `const`
--> $DIR/std-2024-macros.rs:14:36 --> $DIR/std-2024-macros.rs:11:36
| |
LL | let _: Vec<Vec<String>> = vec![const { vec![] }; 10]; LL | let _: Vec<Vec<String>> = vec![const { vec![] }; 10];
| ^^^^^ no rules expected this token in macro call | ^^^^^ no rules expected this token in macro call
| |
= note: while trying to match end of macro = note: while trying to match end of macro
error: aborting due to 5 previous errors error: aborting due to 2 previous errors