about summary refs log tree commit diff
diff options
context:
space:
mode:
authorxFrednet <xFrednet@gmail.com>2022-06-25 14:16:33 +0200
committerxFrednet <xFrednet@gmail.com>2022-06-25 14:37:51 +0200
commit525f5ee7ac9f69fd007bc11bd3dfdce24faa0a4e (patch)
treeb76c00c76bfbfb955f2db7e8f89916d274ee56db
parentae4900c9b83b111df8eb55ac1e914e498d6a2746 (diff)
downloadrust-525f5ee7ac9f69fd007bc11bd3dfdce24faa0a4e.tar.gz
rust-525f5ee7ac9f69fd007bc11bd3dfdce24faa0a4e.zip
Update `useless_attribute` docs and allow `macro_use_imports`
-rw-r--r--clippy_lints/src/attrs.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs
index ed12ad9c367..4bcbeacf9fe 100644
--- a/clippy_lints/src/attrs.rs
+++ b/clippy_lints/src/attrs.rs
@@ -78,10 +78,17 @@ declare_clippy_lint! {
     /// Checks for `extern crate` and `use` items annotated with
     /// lint attributes.
     ///
-    /// This lint permits `#[allow(unused_imports)]`, `#[allow(deprecated)]`,
-    /// `#[allow(unreachable_pub)]`, `#[allow(clippy::wildcard_imports)]` and
-    /// `#[allow(clippy::enum_glob_use)]` on `use` items and `#[allow(unused_imports)]` on
-    /// `extern crate` items with a `#[macro_use]` attribute.
+    /// This lint permits lint attributes for lints emitted on the items themself.
+    /// For `use` items these lints are:
+    /// * deprecated
+    /// * unreachable_pub
+    /// * unused_imports
+    /// * clippy::enum_glob_use
+    /// * clippy::macro_use_imports
+    /// * clippy::wildcard_imports
+    ///
+    /// For `extern crate` items these lints are:
+    /// * `unused_imports` on items with `#[macro_use]`
     ///
     /// ### Why is this bad?
     /// Lint attributes have no effect on crate imports. Most
@@ -347,7 +354,10 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
                                             || extract_clippy_lint(lint).map_or(false, |s| {
                                                 matches!(
                                                     s.as_str(),
-                                                    "wildcard_imports" | "enum_glob_use" | "redundant_pub_crate",
+                                                    "wildcard_imports"
+                                                        | "enum_glob_use"
+                                                        | "redundant_pub_crate"
+                                                        | "macro_use_imports",
                                                 )
                                             })
                                         {