2019-06-08 03:36:43 -05:00
|
|
|
#![feature(rustc_attrs)]
|
2015-02-14 04:45:43 -06:00
|
|
|
|
2015-01-02 16:44:21 -06:00
|
|
|
macro_rules! test { ($nm:ident,
|
2014-03-26 18:14:07 -05:00
|
|
|
#[$a:meta],
|
2015-01-02 16:44:21 -06:00
|
|
|
$i:item) => (mod $nm { #[$a] $i }); }
|
2013-08-08 12:28:06 -05:00
|
|
|
|
|
|
|
test!(a,
|
|
|
|
#[cfg(qux)],
|
2014-11-14 11:18:10 -06:00
|
|
|
pub fn bar() { });
|
2013-08-08 12:28:06 -05:00
|
|
|
|
|
|
|
test!(b,
|
|
|
|
#[cfg(not(qux))],
|
2014-11-14 11:18:10 -06:00
|
|
|
pub fn bar() { });
|
2013-08-08 12:28:06 -05:00
|
|
|
|
|
|
|
// test1!(#[bar])
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2013-08-08 12:28:06 -05:00
|
|
|
fn main() {
|
2017-01-11 16:18:08 -06:00
|
|
|
a::bar(); //~ ERROR cannot find function `bar` in module `a`
|
2013-08-08 12:28:06 -05:00
|
|
|
b::bar();
|
|
|
|
}
|