Closed
Description
The use foo::foo;
line seems to do nothing at all, the reference to foo
inside main
still seems to resolve to the outer foo
.
mod foo {
pub mod foo {
pub fn f() {}
}
}
use foo::foo;
fn main() {
foo::f();
}
hw.rs:10:4: 10:10 error: unresolved name: foo::f hw.rs:10 foo::f(); ^~~~~~
Should the use
item just be illegal if it collides with an existing name? This issue confused me for quite a while with the rust-sdl
package's sdl
crate that contains an sdl
mod.