rust/src/test/compile-fail/macro-outer-attributes.rs
2013-10-06 14:39:25 -07:00

22 lines
359 B
Rust

#[feature(macro_rules)];
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();
}