-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
I tried this code (playground):
use a::*;
mod a {
pub use b::*;
mod b {
pub const SOME_VALUE: u32 = 1;
}
pub use c::*;
mod c {
pub const SOME_VALUE: u32 = 2;
}
}
fn main() {
assert_eq!(SOME_VALUE, 1);
}
I expected to see this happen: an error like error[E0659]: SOME_VALUE is ambiguous
Instead, this happened: the code compiles and runs to completion.
If you put the use a::*
after the mod a
, the expected error is thrown.
Meta
This happens both on stable and nightly.
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.