Consider this layout
// main.rs
mod foo;
fn main() {}
// foo.rs
mod bar;
// bar.rs
// empty
It generates cannot declare a new module at this location error for mod bar;, which is good.
However, If I explicitly specify #[path = ] for mod foo; it compiles:
// main.rs
#[path = "foo.rs"]
mod foo;
fn main() {}
// foo.rs
mod bar;
// bar.rs
// empty
I don't know if this is expected behavior or not, but it looks suspicious to me .
Consider this layout
It generates
cannot declare a new module at this locationerror formod bar;, which is good.However, If I explicitly specify
#[path = ]formod foo;it compiles:I don't know if this is expected behavior or not, but it looks suspicious to me .