Closed
Description
I tried this code:
mod foo {
pub mod bar {
pub mod bar {
pub fn foobar() {}
}
}
}
use foo::*;
use bar::bar;
use bar::foobar;
fn main() {
bar::foobar();
}
I expected to see this happen: Compilation error. This use bar::bar;
shadows one (glob-imported) bar
with another bar
. As far as I know, this should be forbidden.
Instead, this happened: this code successfully compiled.
Meta
rustc --version --verbose
:
rustc 1.47.0-nightly (d7f945163 2020-07-19)
binary: rustc
commit-hash: d7f94516345a36ddfcd68cbdf1df835d356795c3
commit-date: 2020-07-19
host: x86_64-unknown-linux-gnu
release: 1.47.0-nightly
LLVM version: 10.0
c.c. @matklad
c.c. @petrochenkov
Metadata
Metadata
Assignees
Labels
Area: Name/path resolution done by `rustc_resolve` specificallyCategory: This is a bug.High priorityRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.