E0603name-resolution

Module/item is private

Tried to access an item that isn't visible from the call site.

Repro

mod inner {
    fn helper() { println!("inner"); }
}
fn main() { inner::helper(); }   // E0603: helper is private

Why

Items default to private. Without pub (or a more restrictive pub(crate) / pub(super)), only code inside the same module sees them.

Fix

- Add visibility: pub fn helper() {} or pub(crate) fn helper() {}. - For items used only within the crate, prefer pub(crate) over pub — keeps the public API surface minimal. - For struct fields, pub struct Foo { pub bar: i32 } exposes the field; otherwise add a pub getter. - Re-export with pub use to flatten module structure for callers.

Patterns that solve this