You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warning: unused import: `MyTrait`
--> src/main.rs:9:27
|
9 | use super::{MyStruct, MyTrait};
| ^^^^^^^
|
= note: #[warn(unused_imports)] on by default
The use of used items through use super::*; in the submodule is handled inconsistently for types vs. traits. The use of the struct from the submodule inner_mod is detected and counted as a use of the use statement in outer_mod, but the same is not true of the use of the trait-- rustc misses that it is used via use super::*; in inner_mod and reports it as unused.
The text was updated successfully, but these errors were encountered:
I've seen this a bunch of times and always just thought that trait used-ness detection was broken, but it's actually something much more specific:
(playground)
The code above produces the following warning:
The use of
use
d items throughuse super::*;
in the submodule is handled inconsistently for types vs. traits. The use of the struct from the submoduleinner_mod
is detected and counted as a use of theuse
statement inouter_mod
, but the same is not true of the use of the trait-- rustc misses that it is used viause super::*;
ininner_mod
and reports it as unused.The text was updated successfully, but these errors were encountered: