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

extern crate derive_helper_shadowing;
use derive_helper_shadowing::*;

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

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

        mod inner {
            #[my_attr] //~ ERROR attribute `my_attr` is currently unknown
            struct V;
        }

        0
    }]
}

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