summary refs log tree commit diff
path: root/src/test/compile-fail/macro-outer-attributes.rs
blob: 23c3e80cd3b2b7f5dac908484732cc4b58990001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
macro_rules! test ( ($nm:ident,
                     $a:attr,
                     $i:item) => (mod $nm { $a $i }); )

test!(a,
      #[cfg(qux)],
      pub fn bar() { })

test!(b,
      #[cfg(not(qux))],
      pub fn bar() { })

// test1!(#[bar])
#[qux]
fn main() {
    a::bar(); //~ ERROR unresolved name `a::bar`
    b::bar();
}