use anyhow::Result;
treated as unused import if only tests use it
#9236
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
Summary
If I add
and use
Result<T>
only in my tests, clippy thinks this import is unused.Lint Name
unused_imports
Reproducer
This is all the code you need to have this false warning:
The warning:
To show that this import is used, remove it:
If you run the test, it shows an error:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: