Skip to content

Commit e9761bd

Browse files
committed
useless_attribute: allow dead_code
Closes rust-lang/rust-clippy#4467
1 parent 17d2ab8 commit e9761bd

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

clippy_lints/src/attrs/useless_attribute.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub(super) fn check(cx: &LateContext<'_>, item: &Item<'_>, attrs: &[Attribute])
2626
|| is_word(lint, sym!(unused))
2727
|| is_word(lint, sym!(unused_import_braces))
2828
|| is_word(lint, sym!(unused_braces))
29+
|| is_word(lint, sym!(dead_code))
2930
|| extract_clippy_lint(lint).map_or(false, |s| {
3031
matches!(
3132
s.as_str(),

tests/ui/useless_attribute.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ use module::{Struct};
9292
fn main() {
9393
test_indented_attr();
9494
}
95+
96+
// Regression test for https://github.com/rust-lang/rust-clippy/issues/4467
97+
#[allow(dead_code)]
98+
use std::collections as puppy_doggy;

tests/ui/useless_attribute.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ use module::{Struct};
9292
fn main() {
9393
test_indented_attr();
9494
}
95+
96+
// Regression test for https://github.com/rust-lang/rust-clippy/issues/4467
97+
#[allow(dead_code)]
98+
use std::collections as puppy_doggy;

0 commit comments

Comments
 (0)