无法声明模块"无法在此位置声明新模块"

时间:2015-08-15 04:01:48

标签: rust

我有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`

这有什么问题?

0 个答案:

没有答案