summary refs log tree commit diff
path: root/tests/ui/macros/expr_2021_inline_const.rs
blob: ebc5ea36421086c84dde2be45bbcfd68d7f67405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ 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
#![feature(expr_fragment_specifier_2024)]
#![allow(incomplete_features)]

macro_rules! m2021 {
    ($e:expr_2021) => {
        $e
    };
}

macro_rules! m2024 {
    ($e:expr) => {
        $e
    };
}
fn main() {
    m2021!(const { 1 }); //~ ERROR: no rules expected the token `const`
    m2024!(const { 1 }); //[edi2021]~ ERROR: no rules expected the token `const`
}