我有3个文件:lib.rs,file2.rs和file3.rs。我lib.rs我有这个:
mod file2;
use file2::Struct2;
它运作良好。但是,在file3中执行相同操作时会出现错误:
mod file2;
use file2::Struct2;
=> error: cannot declare a new module at this location
如果我删除mod file2
声明,我会得到:
error: unresolved import `Struct2`
这有什么问题?