Closed
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.