You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
^~~~~~~