- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically
Description
Given the following setup,
use test;
mod test {}rustc says
mod-usage.rs:1:5: 1:9 error: unresolved import (maybe you meant `test::*`?)
mod-usage.rs:1 use test;
                   ^~~~
I ran into this while refactoring, but I imagine newcomers getting used to the use/mod distinction (and the fact that mod automatically uses) would benefit from a message more like:
mod-usage.rs:1:5: 1:9 error: cannot import `test` because it was already defined:
mod-usage.rs:1 use test;
                   ^~~~ import
mod-usage.rs:2 mod test {}
                   ^~~~ definition
It's also a bit strange that double-imports are allowed, but the situation above isn't. RFC PR 116 could help regularize things.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically