-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
Feedback from a user forum thread. This code:
mod foo {
}
mod bar {
mod foo;
}
currently suggests:
= help: name the file either foo.rs or foo/mod.rs inside the directory "src/bar"
This is awkwardly worded. It doesn't clearly explain that this syntax creates a new module. It doesn't guess that the user may have meant use crate::foo
.
I suggest:
-
Improve wording of the message. "To create a new module
crate::bar::foo
, create "src/bar/foo.rs" file" (to keep it simple, without also suggesting 2015-edition path). -
If there already is a module with that name, suggest
use
instead.
Darksonn and OptimisticPeach
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.