Skip to content

Commit

Permalink
useless_attribute: allow dead_code
Browse files Browse the repository at this point in the history
Closes #4467
  • Loading branch information
9999years committed May 2, 2024
1 parent 17d2ab8 commit e9761bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions clippy_lints/src/attrs/useless_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/useless_attribute.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 4 additions & 0 deletions tests/ui/useless_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit e9761bd

Please sign in to comment.