diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index 340111edcf1..f2937d51340 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -564,6 +564,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { || is_word(lint, sym::deprecated) || is_word(lint, sym!(unreachable_pub)) || is_word(lint, sym!(unused)) + || is_word(lint, sym!(unused_import_braces)) || 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 c7d611f36cf..d1cdf73d559 100644 --- a/tests/ui/useless_attribute.fixed +++ b/tests/ui/useless_attribute.fixed @@ -80,6 +80,14 @@ pub mod split { #[allow(clippy::single_component_path_imports)] use regex; +mod module { + pub(crate) struct Struct; +} + +#[rustfmt::skip] +#[allow(unused_import_braces)] +use module::{Struct}; + fn main() { test_indented_attr(); } diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs index 00cfa8f5d54..d6aa7fa242c 100644 --- a/tests/ui/useless_attribute.rs +++ b/tests/ui/useless_attribute.rs @@ -80,6 +80,14 @@ pub mod split { #[allow(clippy::single_component_path_imports)] use regex; +mod module { + pub(crate) struct Struct; +} + +#[rustfmt::skip] +#[allow(unused_import_braces)] +use module::{Struct}; + fn main() { test_indented_attr(); }