2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2013-06-21 22:20:00 -05:00
|
|
|
// compile-flags:
|
|
|
|
|
|
|
|
// check that cfg correctly chooses between the macro impls (see also
|
|
|
|
// cfg-macros-foo.rs)
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2013-06-21 22:20:00 -05:00
|
|
|
#[cfg(foo)]
|
2014-12-18 22:48:26 -06:00
|
|
|
#[macro_use]
|
2013-06-21 22:20:00 -05:00
|
|
|
mod foo {
|
|
|
|
macro_rules! bar {
|
|
|
|
() => { true }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(foo))]
|
2014-12-18 22:48:26 -06:00
|
|
|
#[macro_use]
|
2013-06-21 22:20:00 -05:00
|
|
|
mod foo {
|
|
|
|
macro_rules! bar {
|
|
|
|
() => { false }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-03 17:30:54 -06:00
|
|
|
pub fn main() {
|
2013-06-21 22:20:00 -05:00
|
|
|
assert!(!bar!())
|
|
|
|
}
|