2017-05-31 10:03:41 -05:00
|
|
|
#![feature(decl_macro)]
|
2017-05-12 02:53:58 -05:00
|
|
|
#![deny(unused_macros)]
|
2022-04-17 08:54:04 -05:00
|
|
|
// To make sure we are not hitting this
|
|
|
|
#![deny(unused_macro_rules)]
|
2017-05-12 02:53:58 -05:00
|
|
|
|
|
|
|
// Most simple case
|
2017-05-31 10:03:41 -05:00
|
|
|
macro unused { //~ ERROR: unused macro definition
|
|
|
|
() => {}
|
2017-05-12 02:53:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_macros)]
|
|
|
|
mod bar {
|
|
|
|
// Test that putting the #[deny] close to the macro's definition
|
|
|
|
// works.
|
|
|
|
|
|
|
|
#[deny(unused_macros)]
|
2017-05-31 10:03:41 -05:00
|
|
|
macro unused { //~ ERROR: unused macro definition
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod boo {
|
|
|
|
pub(crate) macro unused { //~ ERROR: unused macro definition
|
|
|
|
() => {}
|
2017-05-12 02:53:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|