]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unused/unused-attr-macro-rules.rs
Auto merge of #87284 - Aaron1011:remove-paren-special, r=petrochenkov
[rust.git] / src / test / ui / unused / unused-attr-macro-rules.rs
1 #![deny(unused_attributes)]
2 // Unused attributes on macro_rules requires special handling since the
3 // macro_rules definition does not survive towards HIR.
4
5 // A sample of various built-in attributes.
6 #[macro_export]
7 #[macro_use] //~ ERROR unused attribute
8 #[path="foo"] //~ ERROR unused attribute
9 #[recursion_limit="1"] //~ ERROR unused attribute
10                        //~| ERROR crate-level attribute should be an inner attribute
11 macro_rules! foo {
12     () => {};
13 }
14
15 // The following should not warn about unused attributes.
16 #[allow(unused)]
17 macro_rules! foo2 {
18     () => {};
19 }
20
21 #[cfg(FALSE)]
22 macro_rules! foo {
23     () => {};
24 }
25
26 /// Some docs
27 #[deprecated]
28 #[doc = "more docs"]
29 #[macro_export]
30 macro_rules! bar {
31     () => {};
32 }
33
34 fn main() {}