rust/src/test/ui/issues/issue-75906.rs
David Wood 27bb27f71c
resolve: private fields in tuple struct ctor diag
This commit improves the diagnostic emitted when a tuple struct is being
constructed which has private fields so that private fields are
labelled and the message is improved.

Signed-off-by: David Wood <david@davidtw.co>
2020-10-26 14:56:27 +00:00

13 lines
233 B
Rust

mod m {
pub struct Foo { x: u8 }
pub struct Bar(u8);
}
use m::{Foo, Bar};
fn main() {
let x = Foo { x: 12 };
let y = Bar(12);
//~^ ERROR cannot initialize a tuple struct which contains private fields [E0423]
}