mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Migrate alloc to Rust 2024
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<String>> = vec![const { vec![] }];
|
||||
//~^ ERROR: no rules expected keyword `const`
|
||||
let _: Vec<Vec<String>> = vec![const { vec![] }; 10];
|
||||
//~^ ERROR: no rules expected keyword `const`
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
error: no rules expected keyword `const`
|
||||
--> $DIR/std-2024-macros.rs:9:36
|
||||
|
|
||||
LL | let _: Vec<Vec<String>> = 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<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 2 previous errors
|
||||
|
||||
Reference in New Issue
Block a user