summaryrefslogtreecommitdiffstats
path: root/src/test/ui/macros/macro-inner-attributes.rs
blob: a8cda23075b6fdcb2aa734a8a5f06e1dd83bd6b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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() { });

#[rustc_dummy]
fn main() {
    a::bar();
    //~^ ERROR failed to resolve: use of undeclared crate or module `a`
    b::bar();
}