rust/tests/ui/lint/inert-attr-macro.rs
2023-01-11 09:32:08 +00:00

21 lines
496 B
Rust

// check-pass
#![warn(unused)]
macro_rules! foo {
() => {}
}
fn main() {
#[inline] foo!(); //~ WARN unused attribute `inline`
// This does nothing, since `#[allow(warnings)]` is itself
// an inert attribute on a macro call
#[allow(warnings)] #[inline] foo!(); //~ WARN unused attribute `allow`
//~^ WARN unused attribute `inline`
// This does work, since the attribute is on a parent
// of the macro invocation.
#[allow(warnings)] { #[inline] foo!(); }
}