With the following bar.rs file:
use foo::Bar;
pub mod foo;
fn main() {
let a = Bar;
}
and in the same directory a foo.rs file:
we have the following error:
bar.rs:3:5: error: no candidate found for module foo
3 | pub mod foo;
| ^~~
bar.rs:3:5: error: no candidate found for module foo
bar.rs:1:10: error: unresolved import ‘foo::Bar’ [E0433]
1 | use foo::Bar;
| ^~~
bar.rs:6:13: error: cannot find value ‘Bar’ in this scope [E0425]
6 | let a = Bar;
| ^~~
rustc bar.rs does not produce any error.