-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-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
Let's assume the following code:
mod foo {
#[derive(Debug)]
pub struct Foo;
}
mod bar {}
use bar::Foo;
fn main() {
println!("{:?}", Foo);
}If I leave out the use statement, rust provides me with helpful suggestions:
9 | println!("{:?}", Foo);
| ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
|
1 | use foo::Foo;
|If I have the incorrect use statement, though, rust just states that it's incorrect:
|
8 | use bar::Foo;
| ^^^^^^^^ no `Foo` in `bar`I'd like to suggest a message along the lines of help: did you mean one of these imports from other modules?.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-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.