about summary refs log tree commit diff
path: root/tests/ui/macros/macro-rules-attr-nested.rs
blob: af5c30f00dd9d4c87b4564af49946a6ed986b261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ run-pass
//@ check-run-results
#![feature(macro_attr)]

macro_rules! nest {
    attr() { struct $name:ident; } => {
        println!("nest");
        #[nest(1)]
        struct $name;
    };
    attr(1) { struct $name:ident; } => {
        println!("nest(1)");
        #[nest(2)]
        struct $name;
    };
    attr(2) { struct $name:ident; } => {
        println!("nest(2)");
    };
}

fn main() {
    #[nest]
    struct S;
}