This commit adjusts the missing field diagnostic logic for struct expressions in typeck to improve the diagnostic when the missing fields are inaccessible. Signed-off-by: David Wood <david@davidtw.co>
10 lines
206 B
Rust
10 lines
206 B
Rust
pub mod foo {
|
|
pub struct Foo {
|
|
you_cant_use_this_field: bool,
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
foo::Foo {};
|
|
//~^ ERROR cannot construct `Foo` with struct literal syntax due to inaccessible fields
|
|
}
|