src/iter
mod.rs
_map.rs // Defines `struct Map`, exposed as `iter::Map`
_filter.rs // Defines `struct Filter`, exposed as `iter::Filter`
..etc
mod foo {
mod {
pub struct Foo; // this is available as foo::Foo
// Cannot reference Bar::field
}
// available as foo::Bar
pub struct Bar {
field: u32, // only visible within this anonymous module
impl Bar {
// same as private -- only available within this anon module
// this works *exactly* as if the `mod` declaration was a proper module, just
// one that doesn't have an externally-accessible path, and with
High-level plan
Revamping module declarations and privacy
Anonymous modules
src/iter mod.rs _map.rs // Defines `struct Map`, exposed as `iter::Map` _filter.rs // Defines `struct Filter`, exposed as `iter::Filter` ..etcmod foo { mod { pub struct Foo; // this is available as foo::Foo // Cannot reference Bar::field } mod { // available as foo::Bar pub struct Bar { field: u32, // only visible within this anonymous module } impl Bar { // same as private -- only available within this anon module // this works *exactly* as if the `mod` declaration was a proper module, just // one that doesn't have an externally-accessible path, and with