I am trying to call a function from a module located in a separate file, the function is public, and I call it using the full path, but rustc still complains about the "unresolved name".
a.rs
pub mod b; fn main() { b::f() }
b.rs
pub mod b { pub fn f(){ println!("Hello World!"); } }
Compilation
$ rustc a.rs a.rs:3:5: 3:9 error: unresolved name `b::f`.
When I move the module to the main file of the box, everything works fine.
one_file.rs
pub mod b { pub fn f(){ println!("Hello World!"); } } fn main() { b::f() }
Shouldn't these two paths be equivalent? Am I doing something wrong, or is it a mistake in rustc?
source share