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
|
|
|
|
2019-06-08 11:36:43 +03:00
|
|
|
#[rustc_dummy]
|
2013-08-08 13:28:06 -04:00
|
|
|
fn main() {
|
|
|
|
a::bar();
|
2020-08-27 13:27:14 +01:00
|
|
|
//~^ ERROR failed to resolve: use of undeclared crate or module `a`
|
2013-08-08 13:28:06 -04:00
|
|
|
b::bar();
|
|
|
|
}
|