Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FP single_component_path_imports #5210

Closed
matthiaskrgr opened this issue Feb 20, 2020 · 0 comments · Fixed by #6905
Closed

FP single_component_path_imports #5210

matthiaskrgr opened this issue Feb 20, 2020 · 0 comments · Fixed by #6905
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 20, 2020

clippy 0.0.212 (2855b21 2020-02-19)

Cargo.toml:

...
[dependencies]
crypto-hash = "0.3.1"

main.rs:

use self::crypto_hash::{Algorithm, Hasher};
use crypto_hash;

fn main() {}

This will cause a warning:

warning: this import is redundant
 --> src/main.rs:2:1
  |
2 | use crypto_hash;
  | ^^^^^^^^^^^^^^^^ help: remove it entirely
  |
  = note: `#[warn(clippy::single_component_path_imports)]` on by default

but removing it will lead to a compiler error:

error[E0432]: unresolved import `self::crypto_hash`
 --> src/main.rs:1:11
  |
1 | use self::crypto_hash::{Algorithm, Hasher};
  |           ^^^^^^^^^^^ maybe a missing crate `crypto_hash`?

error: aborting due to previous error
@matthiaskrgr matthiaskrgr added C-bug Category: Clippy is not doing the correct thing I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied labels Feb 21, 2020
@matthiaskrgr matthiaskrgr added the I-false-positive Issue: The lint was triggered on code it shouldn't have label Dec 18, 2020
bors added a commit that referenced this issue Apr 5, 2021
…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
bors added a commit that referenced this issue Apr 6, 2021
…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
bors added a commit that referenced this issue Apr 6, 2021
…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
@bors bors closed this as completed in 67fad01 Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant