]> git.lizzy.rs Git - rust.git/blob - tests/ui/useless_attribute.fixed
Add run-rustfix for useless_attribute test
[rust.git] / tests / ui / useless_attribute.fixed
1 // run-rustfix
2 // aux-build:proc_macro_derive.rs
3
4 #![warn(clippy::useless_attribute)]
5 #![warn(unreachable_pub)]
6
7 #![allow(dead_code)]
8 #![cfg_attr(feature = "cargo-clippy", allow(dead_code))]
9 #[rustfmt::skip]
10 #[cfg_attr(feature = "cargo-clippy",
11            allow(dead_code))]
12 #[allow(unused_imports)]
13 #[allow(unused_extern_crates)]
14 #[macro_use]
15 extern crate clippy_lints;
16
17 #[macro_use]
18 extern crate proc_macro_derive;
19
20 // don't lint on unused_import for `use` items
21 #[allow(unused_imports)]
22 use std::collections;
23
24 // don't lint on deprecated for `use` items
25 mod foo {
26     #[deprecated]
27     pub struct Bar;
28 }
29 #[allow(deprecated)]
30 pub use foo::Bar;
31
32 // This should not trigger the lint. There's lint level definitions inside the external derive
33 // that would trigger the useless_attribute lint.
34 #[derive(DeriveSomething)]
35 struct Baz;
36
37 // don't lint on unreachable_pub for `use` items
38 mod a {
39     mod b {
40         #[allow(dead_code)]
41         #[allow(unreachable_pub)]
42         pub struct C {}
43     }
44
45     #[allow(unreachable_pub)]
46     pub use self::b::C;
47 }
48
49 fn main() {}