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
I noticed some incorrect 'unused import' warnings, and after looking into it some more found some strange incorrect behavior when importing traits. It may extend to other imports.
Bug
The following program seems correct:
mod foo {pubtraitFoo<letN:u32>{}}use foo::Foo;pubtraitBar<T,letN:u32>whereT:Foo<N>{}fnmain(){}
but it compiles with a seemingly incorrect warning:
Aim
I noticed some incorrect 'unused import' warnings, and after looking into it some more found some strange incorrect behavior when importing traits. It may extend to other imports.
Bug
The following program seems correct:
but it compiles with a seemingly incorrect warning:
since
Foo
is clearly used inBar
's declaration.Removing the
use::foo:Foo
line does not cause a compilation error, which I also found odd.Curiously, adding a second trait causes for the warning to go away:
but this depends on the order of the declarations - the following program does emit the original warning:
Finally, placing the new trait inside a new module causes a compilation error instead:
The text was updated successfully, but these errors were encountered: