Closed
Description
This shouldn't be the case, as child modules have access to the private items of parent modules.
Example:
pub mod foo {
struct FooItem;
pub mod bar {
// use foo::FooItem; // Direct import works for both public/private
use foo::*; // Only works if `foo::FooItem` is public
pub fn bar_fn() {
let _ = FooItem;
}
}
}
fn main() {
foo::bar::bar_fn();
}
This gives the error:
<anon>:7:21: 7:28 error: unresolved name `FooItem`
<anon>:7 let _ = FooItem;
^~~~~~~
Metadata
Metadata
Assignees
Labels
No labels