From f505d4e8e380305e9c028c50e5e3a143d4635161 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 11 Feb 2025 15:20:06 -0800 Subject: [PATCH] Migrate alloc to Rust 2024 --- library/alloc/Cargo.toml | 2 +- tests/ui/macros/std-2024-macros.rs | 4 ++-- tests/ui/macros/std-2024-macros.stderr | 18 ------------------ 3 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 tests/ui/macros/std-2024-macros.stderr diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml index dbdf292433be..8d0253bd29aa 100644 --- a/library/alloc/Cargo.toml +++ b/library/alloc/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/rust-lang/rust.git" description = "The Rust core allocation and collections library" autotests = false autobenches = false -edition = "2021" +edition = "2024" [lib] test = false diff --git a/tests/ui/macros/std-2024-macros.rs b/tests/ui/macros/std-2024-macros.rs index d39b6a9811a5..453c7ee16e5a 100644 --- a/tests/ui/macros/std-2024-macros.rs +++ b/tests/ui/macros/std-2024-macros.rs @@ -1,13 +1,13 @@ // Tests a small handful of macros in the standard library how they handle the // new behavior introduced in 2024 that allows `const{}` expressions. +//@ check-pass + fn main() { assert_eq!(0, const { 0 }); assert_eq!(const { 0 }, const { 0 }); assert_eq!(const { 0 }, 0); let _: Vec> = vec![const { vec![] }]; - //~^ ERROR: no rules expected keyword `const` let _: Vec> = vec![const { vec![] }; 10]; - //~^ ERROR: no rules expected keyword `const` } diff --git a/tests/ui/macros/std-2024-macros.stderr b/tests/ui/macros/std-2024-macros.stderr deleted file mode 100644 index 5395b6eac763..000000000000 --- a/tests/ui/macros/std-2024-macros.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: no rules expected keyword `const` - --> $DIR/std-2024-macros.rs:9:36 - | -LL | let _: Vec> = vec![const { vec![] }]; - | ^^^^^ no rules expected this token in macro call - | - = note: while trying to match end of macro - -error: no rules expected keyword `const` - --> $DIR/std-2024-macros.rs:11:36 - | -LL | let _: Vec> = vec![const { vec![] }; 10]; - | ^^^^^ no rules expected this token in macro call - | - = note: while trying to match end of macro - -error: aborting due to 2 previous errors -