48b0c9da69
This commit modifies name resolution error reporting so that if a name is in scope and has been imported then we do not suggest importing it. This can occur when we add a label about constructors not being visible due to private fields. In these cases, we know that the struct/variant has been imported and we should silence any suggestions to import the struct/variant.
20 lines
274 B
Rust
20 lines
274 B
Rust
mod foo {
|
|
pub struct B(());
|
|
}
|
|
|
|
mod bar {
|
|
use foo::B;
|
|
|
|
fn foo() {
|
|
B(()); //~ ERROR expected function, found struct `B` [E0423]
|
|
}
|
|
}
|
|
|
|
mod baz {
|
|
fn foo() {
|
|
B(()); //~ ERROR cannot find function `B` in this scope [E0425]
|
|
}
|
|
}
|
|
|
|
fn main() {}
|