]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/issue-79593.rs
Bless tests after rebase
[rust.git] / tests / ui / privacy / issue-79593.rs
1 mod foo {
2     pub struct Pub { private: () }
3
4     pub enum Enum {
5         Variant { x: (), y: () },
6         Other
7     }
8
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
17 fn correct() {
18     foo::Pub {};
19     //~^ ERROR cannot construct `Pub` with struct literal syntax due to private fields
20 }
21
22 fn 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
29 fn main() {}