mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Auto merge of #12333 - MarcusGrass:issue-12223, r=Manishearth
Allow unused_imports, and unused_import_braces on `use` Fixes https://github.com/rust-lang/rust-clippy/issues/12223. Both `unused_import_braces` and `unused_imports` are valid on `use`-items, additional to the two previously allowed. changelog: [`useless_attribute`]: Allow `rustc_lint` `unused_import_braces` and `unused_imports` on `use`-items
This commit is contained in:
commit
5a52c8aee9
3 changed files with 17 additions and 0 deletions
|
@ -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(),
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue