From 8d8c0bfb0e2d50ca2a7a4fbbd10cb2e62a319539 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Thu, 2 May 2024 11:55:11 -0700 Subject: [PATCH] useless_attribute: allow clippy::disallowed_types Closes https://github.com/rust-lang/rust-clippy/issues/12753 --- clippy_lints/src/attrs/useless_attribute.rs | 1 + .../ui-toml/toml_disallowed_types/conf_disallowed_types.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/clippy_lints/src/attrs/useless_attribute.rs b/clippy_lints/src/attrs/useless_attribute.rs index 7575f502a7c..7515ee9bbc8 100644 --- a/clippy_lints/src/attrs/useless_attribute.rs +++ b/clippy_lints/src/attrs/useless_attribute.rs @@ -35,6 +35,7 @@ pub(super) fn check(cx: &LateContext<'_>, item: &Item<'_>, attrs: &[Attribute]) | "unsafe_removed_from_name" | "module_name_repetitions" | "single_component_path_imports" + | "disallowed_types" ) }) { diff --git a/tests/ui-toml/toml_disallowed_types/conf_disallowed_types.rs b/tests/ui-toml/toml_disallowed_types/conf_disallowed_types.rs index 7f28efd676f..f02bd07cfe7 100644 --- a/tests/ui-toml/toml_disallowed_types/conf_disallowed_types.rs +++ b/tests/ui-toml/toml_disallowed_types/conf_disallowed_types.rs @@ -40,3 +40,9 @@ fn main() { let _ = HashMap; let _: usize = 64_usize; } + +mod useless_attribute { + // Regression test for https://github.com/rust-lang/rust-clippy/issues/12753 + #[allow(clippy::disallowed_types)] + use std::collections::HashMap; +}