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