Take into account sub modules

This commit is contained in:
ThibsG 2021-03-28 09:35:44 +02:00
parent 1768efa333
commit 6985d13a97
4 changed files with 34 additions and 10 deletions

View file

@ -19,3 +19,9 @@ fn main() {
// False positive #5154, shouldn't trigger lint.
m!();
}
mod hello_mod {
#[allow(dead_code)]
fn hello_mod() {}
}

View file

@ -19,3 +19,9 @@ fn main() {
// False positive #5154, shouldn't trigger lint.
m!();
}
mod hello_mod {
use regex;
#[allow(dead_code)]
fn hello_mod() {}
}

View file

@ -6,5 +6,11 @@ LL | use regex;
|
= note: `-D clippy::single-component-path-imports` implied by `-D warnings`
error: aborting due to previous error
error: this import is redundant
--> $DIR/single_component_path_imports.rs:24:5
|
LL | use regex;
| ^^^^^^^^^^ help: remove it entirely
error: aborting due to 2 previous errors