rust/tests/ui/lint/unused/unused-macros-decl.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
543 B
Rust
Raw Normal View History

#![feature(decl_macro)]
2017-05-12 02:53:58 -05:00
#![deny(unused_macros)]
// To make sure we are not hitting this
#![deny(unused_macro_rules)]
2017-05-12 02:53:58 -05:00
// Most simple case
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)]
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() {}