]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/inert-attr-macro.rs
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
[rust.git] / tests / ui / lint / inert-attr-macro.rs
1 // check-pass
2
3 #![warn(unused)]
4
5 macro_rules! foo {
6     () => {}
7 }
8
9 fn main() {
10     #[inline] foo!(); //~ WARN unused attribute `inline`
11
12     // This does nothing, since `#[allow(warnings)]` is itself
13     // an inert attribute on a macro call
14     #[allow(warnings)] #[inline] foo!(); //~ WARN unused attribute `allow`
15     //~^ WARN unused attribute `inline`
16
17     // This does work, since the attribute is on a parent
18     // of the macro invocation.
19     #[allow(warnings)] { #[inline] foo!(); }
20 }