]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/derive-helper-shadowing.rs
resolve: Introduce a new scope for derive helpers
[rust.git] / src / test / ui / proc-macro / derive-helper-shadowing.rs
1 // edition:2018
2 // aux-build:test-macros.rs
3
4 #[macro_use]
5 extern crate test_macros;
6
7 use test_macros::empty_attr as empty_helper;
8
9 #[empty_helper] //~ ERROR `empty_helper` is ambiguous
10 #[derive(Empty)]
11 struct S {
12     // FIXME No ambiguity, attributes in non-macro positions are not resolved properly
13     #[empty_helper]
14     field: [u8; {
15         use empty_helper; //~ ERROR `empty_helper` is ambiguous
16
17         // FIXME No ambiguity, derive helpers are not put into scope for inner items
18         #[empty_helper]
19         struct U;
20
21         mod inner {
22             // FIXME No ambiguity, attributes in non-macro positions are not resolved properly
23             #[empty_helper]
24             struct V;
25         }
26
27         0
28     }]
29 }
30
31 fn main() {
32     let s = S { field: [] };
33 }