summary refs log tree commit diff
path: root/src/test/ui/proc-macro/dollar-crate.rs
blob: 1460e9a3b2d55ab988a73ee675d9ccd313cd66a9 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// edition:2018
// aux-build:dollar-crate.rs
// aux-build:dollar-crate-external.rs

// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)"

extern crate dollar_crate;
extern crate dollar_crate_external;

type S = u8;

mod local {
    use crate::dollar_crate;

    macro_rules! local {
        () => {
            dollar_crate::m! {
                struct M($crate::S);
            }

            #[dollar_crate::a]
            struct A($crate::S);

            #[derive(dollar_crate::d)]
            struct D($crate::S); //~ ERROR the name `D` is defined multiple times
        };
    }

    local!();
}

mod external {
    use crate::dollar_crate_external;

    dollar_crate_external::external!(); //~ ERROR the name `D` is defined multiple times
}

fn main() {}