Closed
Description
Consider the following piece of code, which compiles:
mod bar {
pub fn foo() { }
}
use bar::foo::{self};
fn main() {
foo();
}
The use
declaration is allowed to use foo
as a module when foo
is actually a function. This should not be allowed.
Further, when foo
does exist as a module, regardless of visibility, self
incorrectly imports items with the same name in that module:
mod bar {
mod foo { }
pub fn foo() { }
}
use bar::foo::{self};
fn main() {
foo();
}