Closed
Description
Given the following code:
mod a {
struct Foo;
}
mod b {
use crate::a::*;
type Bar = Foo;
}
The current output is:
error[E0412]: cannot find type `Foo` in this scope
--> src/lib.rs:7:16
|
7 | type Bar = Foo;
| ^^^ not found in this scope
|
help: consider importing this struct
|
6 | use crate::a::Foo;
|
warning: unused import: `crate::a::*`
--> src/lib.rs:6:9
|
6 | use crate::a::*;
| ^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Ideally the output should look like:
error[E0412]: cannot find type `Foo` in this scope
--> src/lib.rs:7:16
|
7 | type Bar = Foo;
| ^^^ not found in this scope
|
Note: Foo imported [here], but cannot be imported as it is defined as private [here]
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Name/path resolution done by `rustc_resolve` specificallyArea: Visibility / privacyCategory: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Relevant to the compiler team, which will review and decide on the PR/issue.