Migrate core to Rust 2024
This commit is contained in:
parent
590b277d25
commit
0e071c2c6a
8 changed files with 18 additions and 48 deletions
|
@ -9,7 +9,7 @@ autobenches = false
|
|||
# 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
|
||||
# the version of the prelude imported in core/lib.rs.
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
[lib]
|
||||
test = false
|
||||
|
|
|
@ -226,7 +226,7 @@ extern crate self as core;
|
|||
|
||||
#[prelude_import]
|
||||
#[allow(unused)]
|
||||
use prelude::rust_2021::*;
|
||||
use prelude::rust_2024::*;
|
||||
|
||||
#[cfg(not(test))] // See #65860
|
||||
#[macro_use]
|
||||
|
|
|
@ -55,16 +55,16 @@
|
|||
bb3: {
|
||||
StorageDead(_9);
|
||||
- _0 = AllCopy { a: move _2, b: move _5, c: move _8 };
|
||||
+ _0 = copy (*_1);
|
||||
StorageDead(_8);
|
||||
StorageDead(_5);
|
||||
StorageDead(_2);
|
||||
- StorageDead(_10);
|
||||
+ _0 = copy (*_1);
|
||||
+ nop;
|
||||
StorageDead(_8);
|
||||
- StorageDead(_7);
|
||||
+ nop;
|
||||
StorageDead(_5);
|
||||
- StorageDead(_4);
|
||||
+ nop;
|
||||
+ nop;
|
||||
+ nop;
|
||||
StorageDead(_2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@
|
|||
bb3: {
|
||||
StorageDead(_9);
|
||||
_0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
|
||||
StorageDead(_8);
|
||||
StorageDead(_5);
|
||||
StorageDead(_2);
|
||||
StorageDead(_10);
|
||||
StorageDead(_8);
|
||||
StorageDead(_7);
|
||||
StorageDead(_5);
|
||||
StorageDead(_4);
|
||||
StorageDead(_2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@
|
|||
bb3: {
|
||||
StorageDead(_9);
|
||||
_0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
|
||||
StorageDead(_8);
|
||||
StorageDead(_5);
|
||||
StorageDead(_2);
|
||||
StorageDead(_10);
|
||||
StorageDead(_8);
|
||||
StorageDead(_7);
|
||||
StorageDead(_5);
|
||||
StorageDead(_4);
|
||||
StorageDead(_2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use run_make_support::{rustc, source_root};
|
|||
|
||||
fn main() {
|
||||
rustc()
|
||||
.edition("2021")
|
||||
.edition("2024")
|
||||
.arg("-Dwarnings")
|
||||
.crate_type("rlib")
|
||||
.input(source_root().join("library/core/src/lib.rs"))
|
||||
|
|
|
@ -3,11 +3,8 @@
|
|||
|
||||
fn main() {
|
||||
assert_eq!(0, const { 0 });
|
||||
//~^ ERROR: no rules expected keyword `const`
|
||||
assert_eq!(const { 0 }, const { 0 });
|
||||
//~^ ERROR: no rules expected keyword `const`
|
||||
assert_eq!(const { 0 }, 0);
|
||||
//~^ ERROR: no rules expected keyword `const`
|
||||
|
||||
let _: Vec<Vec<String>> = vec![const { vec![] }];
|
||||
//~^ ERROR: no rules expected keyword `const`
|
||||
|
|
|
@ -1,32 +1,5 @@
|
|||
error: no rules expected keyword `const`
|
||||
--> $DIR/std-2024-macros.rs:5:19
|
||||
|
|
||||
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
|
||||
--> $DIR/std-2024-macros.rs:9:36
|
||||
|
|
||||
LL | let _: Vec<Vec<String>> = vec![const { vec![] }];
|
||||
| ^^^^^ 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
|
||||
|
||||
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];
|
||||
| ^^^^^ no rules expected this token in macro call
|
||||
|
|
||||
= note: while trying to match end of macro
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue