No unused import for std::f64 if only f64 types used #40774
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-resolve
Area: Name resolution
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I recently came across several instances of the following problem in a code base:
Why this didn't cause a warning baffled me for a while, until I realize that it was actually imported the type
f64
, even though I had been using it up until that point as a module like:Then later, when I refactored the code (more complex than this toy example), something like this was left:
In this final case, it would be great if
rustc
warned about this sincef64
is always implicitly in scope as a primitive type (I didn't think you could actually import it?).Is this a case where the unused import lint got confused incorrectly?
The text was updated successfully, but these errors were encountered: