diff options
Diffstat (limited to 'tests/ui/macros/macro-outer-attributes.rs')
-rw-r--r-- | tests/ui/macros/macro-outer-attributes.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/macros/macro-outer-attributes.rs b/tests/ui/macros/macro-outer-attributes.rs new file mode 100644 index 000000000..0752f7e31 --- /dev/null +++ b/tests/ui/macros/macro-outer-attributes.rs @@ -0,0 +1,20 @@ +#![feature(rustc_attrs)] + +macro_rules! test { ($nm:ident, + #[$a:meta], + $i:item) => (mod $nm { #[$a] $i }); } + +test!(a, + #[cfg(qux)], + pub fn bar() { }); + +test!(b, + #[cfg(not(qux))], + pub fn bar() { }); + +// test1!(#[bar]) +#[rustc_dummy] +fn main() { + a::bar(); //~ ERROR cannot find function `bar` in module `a` + b::bar(); +} |