2 // aux-build:test-macros.rs
3 // aux-build:derive-helper-shadowing.rs
6 extern crate test_macros;
8 extern crate derive_helper_shadowing;
10 use test_macros::empty_attr as empty_helper;
12 macro_rules! gen_helper_use {
14 #[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope
19 #[empty_helper] //~ ERROR `empty_helper` is ambiguous
20 //~| WARN derive helper attribute is used before it is introduced
21 //~| WARN this was previously accepted
24 #[empty_helper] // OK, no ambiguity, derive helpers have highest priority
26 use empty_helper; //~ ERROR `empty_helper` is ambiguous
28 #[empty_helper] // OK, no ambiguity, derive helpers have highest priority
32 // OK, no ambiguity, the non-helper attribute is not in scope here, only the helper.
38 #[derive(GenHelperUse)] //~ ERROR cannot find attribute `empty_helper` in this scope
41 use empty_helper as renamed;
42 #[renamed] //~ ERROR cannot use a derive helper attribute through an import
50 // OK, no ambiguity, only the non-helper attribute is in scope.
55 let s = S { field: [] };