]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/unused/unused-attr-macro-rules.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / lint / 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 `#[macro_use]` only has an effect
8 #[path="foo"] //~ ERROR #[path]` only has an effect
9 #[recursion_limit="1"] //~ ERROR crate-level attribute should be an inner attribute
10 macro_rules! foo {
11     () => {};
12 }
13
14 // The following should not warn about unused attributes.
15 #[allow(unused)]
16 macro_rules! foo2 {
17     () => {};
18 }
19
20 #[cfg(FALSE)]
21 macro_rules! foo {
22     () => {};
23 }
24
25 /// Some docs
26 #[deprecated]
27 #[doc = "more docs"]
28 #[macro_export]
29 macro_rules! bar {
30     () => {};
31 }
32
33 fn main() {}