1 mod foo { 2 pub struct Pub { private: () } 3 4 pub enum Enum { 5 Variant { x: (), y: () }, 6 Other 7 } 8 correct()9 fn correct() { 10 Pub {}; 11 //~^ ERROR missing field `private` in initializer of `Pub` 12 Enum::Variant { x: () }; 13 //~^ ERROR missing field `y` in initializer of `Enum` 14 } 15 } 16 correct()17fn correct() { 18 foo::Pub {}; 19 //~^ ERROR cannot construct `Pub` with struct literal syntax due to inaccessible fields 20 } 21 wrong()22fn wrong() { 23 foo::Enum::Variant { x: () }; 24 //~^ ERROR missing field `y` in initializer of `Enum` 25 foo::Enum::Variant { }; 26 //~^ ERROR missing fields `x` and `y` in initializer of `Enum` 27 } 28 main()29fn main() {} 30