Skip to content

Commit 97a3ac5

Browse files
committed
Allow unused_imports, and unused_import_braces on use
1 parent 341ae30 commit 97a3ac5

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

clippy_lints/src/attrs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
564564
|| is_word(lint, sym::deprecated)
565565
|| is_word(lint, sym!(unreachable_pub))
566566
|| is_word(lint, sym!(unused))
567+
|| is_word(lint, sym!(unused_import_braces))
568+
|| is_word(lint, sym!(unused_imports))
567569
|| extract_clippy_lint(lint).map_or(false, |s| {
568570
matches!(
569571
s.as_str(),

tests/ui/useless_attribute.fixed

+8
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ pub mod split {
8080
#[allow(clippy::single_component_path_imports)]
8181
use regex;
8282

83+
mod module {
84+
pub(crate) struct Struct;
85+
}
86+
87+
#[rustfmt::skip]
88+
#[allow(unused_import_braces, unused_imports)]
89+
use module::{Struct};
90+
8391
fn main() {
8492
test_indented_attr();
8593
}

tests/ui/useless_attribute.rs

+8
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ pub mod split {
8080
#[allow(clippy::single_component_path_imports)]
8181
use regex;
8282

83+
mod module {
84+
pub(crate) struct Struct;
85+
}
86+
87+
#[rustfmt::skip]
88+
#[allow(unused_import_braces, unused_imports)]
89+
use module::{Struct};
90+
8391
fn main() {
8492
test_indented_attr();
8593
}

0 commit comments

Comments
 (0)