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;
^~~~~~~
The text was updated successfully, but these errors were encountered:
This is actually working as intended. A glob import will only import public items from another module, it will unconditionally ignore all private items. You may be interested in opening an issue in the RFC tracker to track a tweak to this behavior if you'd like to.
This shouldn't be the case, as child modules have access to the private items of parent modules.
Example:
This gives the error:
The text was updated successfully, but these errors were encountered: