]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/privacy-struct-ctor.stderr
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / resolve / privacy-struct-ctor.stderr
1 error[E0423]: expected value, found struct `Z`
2   --> $DIR/privacy-struct-ctor.rs:20:9
3    |
4 LL |     pub struct S(u8);
5    |     ----------------- similarly named tuple struct `S` defined here
6 ...
7 LL |         Z;
8    |         ^
9    |         |
10    |         constructor is not visible here due to private fields
11    |         help: a tuple struct with a similar name exists: `S`
12
13 error[E0423]: expected value, found struct `S`
14   --> $DIR/privacy-struct-ctor.rs:33:5
15    |
16 LL |     S;
17    |     ^ constructor is not visible here due to private fields
18
19 error[E0423]: expected value, found struct `S2`
20   --> $DIR/privacy-struct-ctor.rs:38:5
21    |
22 LL | /     pub struct S2 {
23 LL | |         s: u8
24 LL | |     }
25    | |_____- `S2` defined here
26 ...
27 LL |       S2;
28    |       ^^ help: use struct literal syntax instead: `S2 { s: val }`
29
30 error[E0423]: expected value, found struct `xcrate::S`
31   --> $DIR/privacy-struct-ctor.rs:43:5
32    |
33 LL |     xcrate::S;
34    |     ^^^^^^^^^ constructor is not visible here due to private fields
35    |
36 note: tuple struct `m::S` exists but is inaccessible
37   --> $DIR/privacy-struct-ctor.rs:6:5
38    |
39 LL |     pub struct S(u8);
40    |     ^^^^^^^^^^^^^^^^^ not accessible
41
42 error[E0603]: tuple struct constructor `Z` is private
43   --> $DIR/privacy-struct-ctor.rs:18:12
44    |
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 ...
48 LL |         n::Z;
49    |            ^ private tuple struct constructor
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    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56 help: consider making the field publicly accessible
57    |
58 LL |         pub(in m) struct Z(pub u8);
59    |                            ~~~
60
61 error[E0603]: tuple struct constructor `S` is private
62   --> $DIR/privacy-struct-ctor.rs:29:8
63    |
64 LL |     pub struct S(u8);
65    |                  -- a constructor is private if any of the fields is private
66 ...
67 LL |     m::S;
68    |        ^ private tuple struct constructor
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    |     ^^^^^^^^^^^^^^^^^
75 help: consider making the field publicly accessible
76    |
77 LL |     pub struct S(pub u8);
78    |                  +++
79
80 error[E0603]: tuple struct constructor `S` is private
81   --> $DIR/privacy-struct-ctor.rs:31:19
82    |
83 LL |     pub struct S(u8);
84    |                  -- a constructor is private if any of the fields is private
85 ...
86 LL |     let _: S = m::S(2);
87    |                   ^ private tuple struct constructor
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    |     ^^^^^^^^^^^^^^^^^
94 help: consider making the field publicly accessible
95    |
96 LL |     pub struct S(pub u8);
97    |                  +++
98
99 error[E0603]: tuple struct constructor `Z` is private
100   --> $DIR/privacy-struct-ctor.rs:35:11
101    |
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 ...
105 LL |     m::n::Z;
106    |           ^ private tuple struct constructor
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    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113 help: consider making the field publicly accessible
114    |
115 LL |         pub(in m) struct Z(pub u8);
116    |                            ~~~
117
118 error[E0603]: tuple struct constructor `S` is private
119   --> $DIR/privacy-struct-ctor.rs:41:16
120    |
121 LL |     xcrate::m::S;
122    |                ^ private tuple struct constructor
123    |
124   ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
125    |
126 LL |     pub struct S(u8);
127    |                  -- a constructor is private if any of the fields is private
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);
133    |     ^^^^^^^^^^^^
134
135 error[E0603]: tuple struct constructor `Z` is private
136   --> $DIR/privacy-struct-ctor.rs:45:19
137    |
138 LL |     xcrate::m::n::Z;
139    |                   ^ private tuple struct constructor
140    |
141   ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
142    |
143 LL |         pub(in m) struct Z(pub(in m::n) u8);
144    |                            --------------- a constructor is private if any of the fields is private
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);
150    |         ^^^^^^^^^^^^^^^^^^
151
152 error: aborting due to 10 previous errors
153
154 Some errors have detailed explanations: E0423, E0603.
155 For more information about an error, try `rustc --explain E0423`.