summary refs log tree commit diff
path: root/src/test/ui/proc-macro/derive-helper-shadowing.rs
blob: 59ba1390e13237e023caf6a59e50a0b70c764f8d (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
// aux-build:test-macros.rs

#[macro_use]
extern crate test_macros;

use test_macros::empty_attr as empty_helper;

#[empty_helper] //~ ERROR `empty_helper` is ambiguous
#[derive(Empty)]
struct S {
    // FIXME No ambiguity, attributes in non-macro positions are not resolved properly
    #[empty_helper]
    field: [u8; {
        // FIXME No ambiguity, derive helpers are not put into scope for non-attributes
        use empty_helper;

        // FIXME No ambiguity, derive helpers are not put into scope for inner items
        #[empty_helper]
        struct U;

        mod inner {
            #[empty_helper] //~ ERROR cannot find attribute macro `empty_helper` in this scope
            struct V;
        }

        0
    }]
}

fn main() {
    let s = S { field: [] };
}