-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #6905 - ThibsG:fpSingleComponentPathImports5210, r=gira…
…ffate Fix FP in `single_component_path_imports` lint Fix FP in `single_component_path_imports` lint when the import is reused with `self`, like in `use self::module`. Fixes #5210 changelog: none
- Loading branch information
Showing
6 changed files
with
157 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
error: this import is redundant | ||
--> $DIR/single_component_path_imports.rs:24:5 | ||
| | ||
LL | use regex; | ||
| ^^^^^^^^^^ help: remove it entirely | ||
| | ||
= note: `-D clippy::single-component-path-imports` implied by `-D warnings` | ||
|
||
error: this import is redundant | ||
--> $DIR/single_component_path_imports.rs:6:1 | ||
| | ||
LL | use regex; | ||
| ^^^^^^^^^^ help: remove it entirely | ||
| | ||
= note: `-D clippy::single-component-path-imports` implied by `-D warnings` | ||
|
||
error: aborting due to previous error | ||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// edition:2018 | ||
#![warn(clippy::single_component_path_imports)] | ||
#![allow(unused_imports)] | ||
|
||
use self::regex::{Regex as xeger, RegexSet as tesxeger}; | ||
pub use self::{ | ||
regex::{Regex, RegexSet}, | ||
some_mod::SomeType, | ||
}; | ||
use regex; | ||
|
||
mod some_mod { | ||
pub struct SomeType; | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// edition:2018 | ||
#![warn(clippy::single_component_path_imports)] | ||
#![allow(unused_imports)] | ||
|
||
use regex; | ||
|
||
use self::regex::{Regex as xeger, RegexSet as tesxeger}; | ||
pub use self::{ | ||
regex::{Regex, RegexSet}, | ||
some_mod::SomeType, | ||
}; | ||
|
||
mod some_mod { | ||
pub struct SomeType; | ||
} | ||
|
||
fn main() {} |