Skip to content

Commit 525f5ee

Browse files
committed
Update useless_attribute docs and allow macro_use_imports
1 parent ae4900c commit 525f5ee

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

clippy_lints/src/attrs.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,17 @@ declare_clippy_lint! {
7878
/// Checks for `extern crate` and `use` items annotated with
7979
/// lint attributes.
8080
///
81-
/// This lint permits `#[allow(unused_imports)]`, `#[allow(deprecated)]`,
82-
/// `#[allow(unreachable_pub)]`, `#[allow(clippy::wildcard_imports)]` and
83-
/// `#[allow(clippy::enum_glob_use)]` on `use` items and `#[allow(unused_imports)]` on
84-
/// `extern crate` items with a `#[macro_use]` attribute.
81+
/// This lint permits lint attributes for lints emitted on the items themself.
82+
/// For `use` items these lints are:
83+
/// * deprecated
84+
/// * unreachable_pub
85+
/// * unused_imports
86+
/// * clippy::enum_glob_use
87+
/// * clippy::macro_use_imports
88+
/// * clippy::wildcard_imports
89+
///
90+
/// For `extern crate` items these lints are:
91+
/// * `unused_imports` on items with `#[macro_use]`
8592
///
8693
/// ### Why is this bad?
8794
/// Lint attributes have no effect on crate imports. Most
@@ -347,7 +354,10 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
347354
|| extract_clippy_lint(lint).map_or(false, |s| {
348355
matches!(
349356
s.as_str(),
350-
"wildcard_imports" | "enum_glob_use" | "redundant_pub_crate",
357+
"wildcard_imports"
358+
| "enum_glob_use"
359+
| "redundant_pub_crate"
360+
| "macro_use_imports",
351361
)
352362
})
353363
{

0 commit comments

Comments
 (0)