Open
Description
lib.rs:
mod a1;
mod lib;
a1.rs - empty file.
Error:
error: cannot declare a new module at this location
--> src/lib.rs:1:5
|
1 | mod a1;
| ^^
|
note: maybe move this module `lib` to its own directory via `lib/mod.rs`
--> src/lib.rs:1:5
|
1 | mod a1;
| ^^
note: ... or maybe `use` the module `a1` instead of possibly redeclaring it
--> src/lib.rs:1:5
|
1 | mod a1;
| ^^
Error location and some of the messages incorrectly refer to a1 module instead of lib. Module a1 itself is declared correctly. If I write lib before a1, the error starts making more sense:
lib.rs:
mod lib;
mod a1;
Error:
error: cannot declare a new module at this location
--> src/lib.rs:1:5
|
1 | mod lib;
| ^^^
|
note: maybe move this module `lib` to its own directory via `lib/mod.rs`
--> src/lib.rs:1:5
|
1 | mod lib;
| ^^^
note: ... or maybe `use` the module `lib` instead of possibly redeclaring it
--> src/lib.rs:1:5
|
1 | mod lib;
| ^^^