mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
dd2b027d5d
Much like the previous commit. I think the removal of "the token" in each message is fine here. There are many more error messages that mention tokens without saying "the token" than those that do say it.
28 lines
554 B
Rust
28 lines
554 B
Rust
//@ revisions: edi2021 edi2024
|
|
//@[edi2024]compile-flags: --edition=2024 -Z unstable-options
|
|
//@[edi2021]compile-flags: --edition=2021
|
|
|
|
// This test ensures that the inline const match only on edition 2024
|
|
macro_rules! m2021 {
|
|
($e:expr_2021) => {
|
|
$e
|
|
};
|
|
}
|
|
|
|
macro_rules! m2024 {
|
|
($e:expr) => {
|
|
$e
|
|
};
|
|
}
|
|
|
|
macro_rules! test {
|
|
(expr) => {}
|
|
}
|
|
|
|
fn main() {
|
|
m2021!(const { 1 }); //~ ERROR: no rules expected keyword `const`
|
|
m2024!(const { 1 }); //[edi2021]~ ERROR: no rules expected keyword `const`
|
|
|
|
test!(expr);
|
|
}
|