]>
Commit | Line | Data |
---|---|---|
8bb4bdeb | 1 | error[E0423]: expected value, found struct `Z` |
0731742a | 2 | --> $DIR/privacy-struct-ctor.rs:20:9 |
8bb4bdeb | 3 | | |
e74abb32 XL |
4 | LL | pub struct S(u8); |
5 | | ----------------- similarly named tuple struct `S` defined here | |
6 | ... | |
0531ce1d | 7 | LL | Z; |
8bb4bdeb | 8 | | ^ |
9fa01778 XL |
9 | | | |
10 | | constructor is not visible here due to private fields | |
11 | | help: a tuple struct with a similar name exists: `S` | |
8bb4bdeb XL |
12 | |
13 | error[E0423]: expected value, found struct `S` | |
0731742a | 14 | --> $DIR/privacy-struct-ctor.rs:33:5 |
8bb4bdeb | 15 | | |
0531ce1d | 16 | LL | S; |
2c00a5a8 | 17 | | ^ constructor is not visible here due to private fields |
8bb4bdeb | 18 | |
2c00a5a8 | 19 | error[E0423]: expected value, found struct `S2` |
0731742a | 20 | --> $DIR/privacy-struct-ctor.rs:38:5 |
2c00a5a8 | 21 | | |
e74abb32 XL |
22 | LL | / pub struct S2 { |
23 | LL | | s: u8 | |
24 | LL | | } | |
25 | | |_____- `S2` defined here | |
26 | ... | |
27 | LL | S2; | |
3dfed10e | 28 | | ^^ help: use struct literal syntax instead: `S2 { s: val }` |
2c00a5a8 | 29 | |
8bb4bdeb | 30 | error[E0423]: expected value, found struct `xcrate::S` |
0731742a | 31 | --> $DIR/privacy-struct-ctor.rs:43:5 |
8bb4bdeb | 32 | | |
0531ce1d | 33 | LL | xcrate::S; |
2c00a5a8 | 34 | | ^^^^^^^^^ constructor is not visible here due to private fields |
e74abb32 | 35 | | |
c295e0f8 XL |
36 | note: tuple struct `m::S` exists but is inaccessible |
37 | --> $DIR/privacy-struct-ctor.rs:6:5 | |
041b39d2 | 38 | | |
c295e0f8 XL |
39 | LL | pub struct S(u8); |
40 | | ^^^^^^^^^^^^^^^^^ not accessible | |
8bb4bdeb | 41 | |
e74abb32 | 42 | error[E0603]: tuple struct constructor `Z` is private |
0731742a | 43 | --> $DIR/privacy-struct-ctor.rs:18:12 |
8bb4bdeb | 44 | | |
e74abb32 XL |
45 | LL | pub(in m) struct Z(pub(in m::n) u8); |
46 | | --------------- a constructor is private if any of the fields is private | |
47 | ... | |
0531ce1d | 48 | LL | n::Z; |
ba9703b0 | 49 | | ^ private tuple struct constructor |
dfeec247 XL |
50 | | |
51 | note: the tuple struct constructor `Z` is defined here | |
52 | --> $DIR/privacy-struct-ctor.rs:12:9 | |
53 | | | |
54 | LL | pub(in m) struct Z(pub(in m::n) u8); | |
55 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
9c376795 FG |
56 | help: consider making the field publicly accessible |
57 | | | |
58 | LL | pub(in m) struct Z(pub u8); | |
59 | | ~~~ | |
8bb4bdeb | 60 | |
e74abb32 | 61 | error[E0603]: tuple struct constructor `S` is private |
0731742a | 62 | --> $DIR/privacy-struct-ctor.rs:29:8 |
8bb4bdeb | 63 | | |
e74abb32 XL |
64 | LL | pub struct S(u8); |
65 | | -- a constructor is private if any of the fields is private | |
66 | ... | |
0531ce1d | 67 | LL | m::S; |
ba9703b0 | 68 | | ^ private tuple struct constructor |
dfeec247 XL |
69 | | |
70 | note: the tuple struct constructor `S` is defined here | |
71 | --> $DIR/privacy-struct-ctor.rs:6:5 | |
72 | | | |
73 | LL | pub struct S(u8); | |
74 | | ^^^^^^^^^^^^^^^^^ | |
9c376795 FG |
75 | help: consider making the field publicly accessible |
76 | | | |
77 | LL | pub struct S(pub u8); | |
78 | | +++ | |
8bb4bdeb | 79 | |
e74abb32 | 80 | error[E0603]: tuple struct constructor `S` is private |
0731742a | 81 | --> $DIR/privacy-struct-ctor.rs:31:19 |
2c00a5a8 | 82 | | |
e74abb32 XL |
83 | LL | pub struct S(u8); |
84 | | -- a constructor is private if any of the fields is private | |
85 | ... | |
0531ce1d | 86 | LL | let _: S = m::S(2); |
ba9703b0 | 87 | | ^ private tuple struct constructor |
dfeec247 XL |
88 | | |
89 | note: the tuple struct constructor `S` is defined here | |
90 | --> $DIR/privacy-struct-ctor.rs:6:5 | |
91 | | | |
92 | LL | pub struct S(u8); | |
93 | | ^^^^^^^^^^^^^^^^^ | |
9c376795 FG |
94 | help: consider making the field publicly accessible |
95 | | | |
96 | LL | pub struct S(pub u8); | |
97 | | +++ | |
2c00a5a8 | 98 | |
e74abb32 | 99 | error[E0603]: tuple struct constructor `Z` is private |
0731742a | 100 | --> $DIR/privacy-struct-ctor.rs:35:11 |
8bb4bdeb | 101 | | |
e74abb32 XL |
102 | LL | pub(in m) struct Z(pub(in m::n) u8); |
103 | | --------------- a constructor is private if any of the fields is private | |
104 | ... | |
0531ce1d | 105 | LL | m::n::Z; |
ba9703b0 | 106 | | ^ private tuple struct constructor |
dfeec247 XL |
107 | | |
108 | note: the tuple struct constructor `Z` is defined here | |
109 | --> $DIR/privacy-struct-ctor.rs:12:9 | |
110 | | | |
111 | LL | pub(in m) struct Z(pub(in m::n) u8); | |
112 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
9c376795 FG |
113 | help: consider making the field publicly accessible |
114 | | | |
115 | LL | pub(in m) struct Z(pub u8); | |
116 | | ~~~ | |
8bb4bdeb | 117 | |
e74abb32 | 118 | error[E0603]: tuple struct constructor `S` is private |
0731742a | 119 | --> $DIR/privacy-struct-ctor.rs:41:16 |
8bb4bdeb | 120 | | |
0531ce1d | 121 | LL | xcrate::m::S; |
ba9703b0 | 122 | | ^ private tuple struct constructor |
94222f64 | 123 | | |
e74abb32 | 124 | ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18 |
416331ca | 125 | | |
e74abb32 XL |
126 | LL | pub struct S(u8); |
127 | | -- a constructor is private if any of the fields is private | |
dfeec247 XL |
128 | | |
129 | note: the tuple struct constructor `S` is defined here | |
130 | --> $DIR/auxiliary/privacy-struct-ctor.rs:2:5 | |
131 | | | |
132 | LL | pub struct S(u8); | |
064997fb | 133 | | ^^^^^^^^^^^^ |
8bb4bdeb | 134 | |
e74abb32 | 135 | error[E0603]: tuple struct constructor `Z` is private |
0731742a | 136 | --> $DIR/privacy-struct-ctor.rs:45:19 |
8bb4bdeb | 137 | | |
0531ce1d | 138 | LL | xcrate::m::n::Z; |
ba9703b0 | 139 | | ^ private tuple struct constructor |
94222f64 | 140 | | |
e74abb32 | 141 | ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28 |
416331ca | 142 | | |
e74abb32 XL |
143 | LL | pub(in m) struct Z(pub(in m::n) u8); |
144 | | --------------- a constructor is private if any of the fields is private | |
dfeec247 XL |
145 | | |
146 | note: the tuple struct constructor `Z` is defined here | |
147 | --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9 | |
148 | | | |
149 | LL | pub(in m) struct Z(pub(in m::n) u8); | |
064997fb | 150 | | ^^^^^^^^^^^^^^^^^^ |
8bb4bdeb | 151 | |
2c00a5a8 | 152 | error: aborting due to 10 previous errors |
8bb4bdeb | 153 | |
48663c56 | 154 | Some errors have detailed explanations: E0423, E0603. |
0531ce1d | 155 | For more information about an error, try `rustc --explain E0423`. |