-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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;
| ^^^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.