useless_attribute: allow dead_code

Closes https://github.com/rust-lang/rust-clippy/issues/4467
This commit is contained in:
Rebecca Turner 2024-05-02 11:56:38 -07:00
parent 17d2ab8f62
commit e9761bdc01
No known key found for this signature in database
3 changed files with 9 additions and 0 deletions

View file

@ -26,6 +26,7 @@ pub(super) fn check(cx: &LateContext<'_>, item: &Item<'_>, attrs: &[Attribute])
|| is_word(lint, sym!(unused)) || is_word(lint, sym!(unused))
|| is_word(lint, sym!(unused_import_braces)) || is_word(lint, sym!(unused_import_braces))
|| is_word(lint, sym!(unused_braces)) || is_word(lint, sym!(unused_braces))
|| is_word(lint, sym!(dead_code))
|| extract_clippy_lint(lint).map_or(false, |s| { || extract_clippy_lint(lint).map_or(false, |s| {
matches!( matches!(
s.as_str(), s.as_str(),

View file

@ -92,3 +92,7 @@ use module::{Struct};
fn main() { fn main() {
test_indented_attr(); test_indented_attr();
} }
// Regression test for https://github.com/rust-lang/rust-clippy/issues/4467
#[allow(dead_code)]
use std::collections as puppy_doggy;

View file

@ -92,3 +92,7 @@ use module::{Struct};
fn main() { fn main() {
test_indented_attr(); test_indented_attr();
} }
// Regression test for https://github.com/rust-lang/rust-clippy/issues/4467
#[allow(dead_code)]
use std::collections as puppy_doggy;