summary refs log tree commit diff
path: root/tests/ui/attributes/nonterminal-expansion.rs
blob: 1b2e92a31703cfd87fb7c5357a060444e6056259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ compile-flags: -Zdeduplicate-diagnostics=yes

// Macros were previously expanded in `Expr` nonterminal tokens, now they are not.

macro_rules! pass_nonterminal {
    ($n:expr) => {
        #[repr(align($n))]
        //~^ ERROR expected unsuffixed literal, found `n!()`
        struct S;
    };
}

macro_rules! n {
    () => { 32 };
}

pass_nonterminal!(n!());
//~^ ERROR incorrect `repr(align)` attribute format: `align` expects a literal integer as argument [E0693]

fn main() {}