rust/tests/ui/macros/expr_2021_inline_const.rs
Eric Holk c7cd55f7c5 Stabilize expr_2021 fragment in all editions
Co-authored-by: Michael Goulet <michael@errs.io>
Co-authored-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-10-01 07:51:58 +00:00

28 lines
558 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 the token `const`
m2024!(const { 1 }); //[edi2021]~ ERROR: no rules expected the token `const`
test!(expr);
}