about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/attrs/useless_attribute.rs1
-rw-r--r--tests/ui/useless_attribute.fixed4
-rw-r--r--tests/ui/useless_attribute.rs4
3 files changed, 9 insertions, 0 deletions
diff --git a/clippy_lints/src/attrs/useless_attribute.rs b/clippy_lints/src/attrs/useless_attribute.rs
index 40572731bb1..720e4e7932d 100644
--- a/clippy_lints/src/attrs/useless_attribute.rs
+++ b/clippy_lints/src/attrs/useless_attribute.rs
@@ -26,6 +26,7 @@ pub(super) fn check(cx: &LateContext<'_>, item: &Item<'_>, attrs: &[Attribute])
                                 || is_word(lint, sym!(unused))
                                 || is_word(lint, sym!(unused_import_braces))
                                 || is_word(lint, sym!(unused_braces))
+                                || is_word(lint, sym!(dead_code))
                                 || extract_clippy_lint(lint).map_or(false, |s| {
                                     matches!(
                                         s.as_str(),
diff --git a/tests/ui/useless_attribute.fixed b/tests/ui/useless_attribute.fixed
index cb1c0346404..5fafc05cdde 100644
--- a/tests/ui/useless_attribute.fixed
+++ b/tests/ui/useless_attribute.fixed
@@ -92,3 +92,7 @@ use module::{Struct};
 fn main() {
     test_indented_attr();
 }
+
+// Regression test for https://github.com/rust-lang/rust-clippy/issues/4467
+#[allow(dead_code)]
+use std::collections as puppy_doggy;
diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs
index 44a52cba043..c9de7677ff8 100644
--- a/tests/ui/useless_attribute.rs
+++ b/tests/ui/useless_attribute.rs
@@ -92,3 +92,7 @@ use module::{Struct};
 fn main() {
     test_indented_attr();
 }
+
+// Regression test for https://github.com/rust-lang/rust-clippy/issues/4467
+#[allow(dead_code)]
+use std::collections as puppy_doggy;