Rust cannot find local file through declaration. I have the following file structure in src:
| main.rs
| lib.rs
| test.rs
| prog.rs
| file.rs
In main.rs I have
extern crate cratename;
mod prog;
use cratename::file1::File1;
...
prog::function() // This works
...
#[cfg(test)]
mod test;
In lib.rs I have
pub mod file1;
In test.rs I have
extern crate cratename
use cratename::file1::File1;
mod prog;
#[test]
...
prog::function() // This does not work
...
I keep getting the error
error[E0583]: file not found for module `prog`
I tried putting the declaration in lib.rs but that didn't work. I've tried numerous other permutations involving this declaration along with main.rs but none of it worked. If it helps, prog.rs doesn't contain a struct and it doesn't use the mod keyword, it only contains public functions. This has stumped me for a while. Thank you for your help.