diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index 340111edc..f2937d513 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -564,6 +564,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes { || 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 c7d611f36..d1cdf73d5 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 00cfa8f5d..d6aa7fa24 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(); }