]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/useless_attribute.rs
2 // aux-build:proc_macro_derive.rs
5 #![warn(clippy::useless_attribute)]
6 #![warn(unreachable_pub)]
7 #![feature(rustc_private)]
10 #[cfg_attr(feature = "cargo-clippy", allow(dead_code))]
12 #[allow(unused_imports)]
13 #[allow(unused_extern_crates)]
15 extern crate rustc_middle
;
18 extern crate proc_macro_derive
;
20 fn test_indented_attr() {
21 #[allow(clippy::almost_swapped)]
22 use std
::collections
::HashSet
;
24 let _
= HashSet
::<u32>::default();
27 // don't lint on unused_import for `use` items
28 #[allow(unused_imports)]
31 // don't lint on unused for `use` items
35 // don't lint on deprecated for `use` items
43 // This should not trigger the lint. There's lint level definitions inside the external derive
44 // that would trigger the useless_attribute lint.
45 #[derive(DeriveSomething)]
48 // don't lint on unreachable_pub for `use` items
52 #[allow(unreachable_pub)]
56 #[allow(unreachable_pub)]
60 // don't lint on clippy::wildcard_imports for `use` items
61 #[allow(clippy::wildcard_imports)]
62 pub use std
::io
::prelude
::*;
64 // don't lint on clippy::enum_glob_use for `use` items
65 #[allow(clippy::enum_glob_use)]
66 pub use std
::cmp
::Ordering
::*;
68 // don't lint on clippy::redundant_pub_crate
70 #[allow(clippy::redundant_pub_crate)]
74 // https://github.com/rust-lang/rust-clippy/issues/7511
76 #[allow(clippy::module_name_repetitions)]
77 pub use regex
::SplitN
;
80 // https://github.com/rust-lang/rust-clippy/issues/8768
81 #[allow(clippy::single_component_path_imports)]