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();
}
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jseyfried commentedon Dec 11, 2016
cc @petrochenkov
self
in an import list #38313jseyfried commentedon Dec 12, 2016
Fixed in #38313.
Auto merge of #38313 - jseyfried:self_imports, r=nrc