-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics
Description
fn main() {
use foo::mem;
}
pub mod foo {
use std::mem;
}
gives the error:
error: module `mem` is private
--> <anon>:2:9
|
2 | use foo::mem;
| ^^^^^^^^
error: aborting due to previous error
However, really, we don't consider use std::mem
to be introducing a module, so it's confusing when we say that it's private. This gives off the impression that we typed the correct path, but the library author neglected to make it public.
We should instead give an error that the module/type/etc does not exist, but perhaps note that there is a use
statement that could be made pub use
if the error is from the same crate.
kornelski and jplatte
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics