Closed
Description
I tried this code:
mod a {
pub mod collide {
pub struct Foo {}
}
}
pub use a::*;
pub mod collide {
pub struct Bar {}
}
I expected to see this happen: compilation error, since RFC 116 seems to explicitly prohibit shadowing modules.
Instead, this happened: compiles successfully and the collide
module is shadowed, playground.
Related to #111336 which looks at other glob shadowing problems.
Meta
rustc --version --verbose
:
rustc 1.71.0-nightly (39c6804b9 2023-04-19)
binary: rustc
commit-hash: 39c6804b92aa202369e402525cee329556bc1db0
commit-date: 2023-04-19
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2
Also tested on Nightly version: 1.71.0-nightly (2023-05-07 c4190f2d3a46a59f435f)
via the playground.
If RFC 116 has been superseded or withdrawn, I'm sorry — after some digging, I wasn't able to find any information to that effect, but perhaps I wasn't looking in the right places.