I have three files in src/
, like so:
lib.rs
pub mod first
first.rs
fn hello() {}
main.rs
pub mod lib
This gives me an error saying:
error[E0583]: file not found for module `first`
--> src/lib.rs:1:9
|
1 | pub mod first;
| ^^^^^
|
= help: name the file either lib/first.rs or lib/first/mod.rs inside the directory "src"
Now, if I remove pub mod lib
from main.rs
, everything compiles fine.
I don't understand why this is happening.