]> git.lizzy.rs Git - rust.git/blob - src/test/ui/privacy/private-in-public.stderr
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / privacy / private-in-public.stderr
1 error[E0446]: private type `types::Priv` in public interface
2   --> $DIR/private-in-public.rs:13:5
3    |
4 LL |     struct Priv;
5    |     ----------- `types::Priv` declared as private
6 ...
7 LL |     pub const C: Priv = Priv;
8    |     ^^^^^^^^^^^^^^^^^ can't leak private type
9
10 error[E0446]: private type `types::Priv` in public interface
11   --> $DIR/private-in-public.rs:14:5
12    |
13 LL |     struct Priv;
14    |     ----------- `types::Priv` declared as private
15 ...
16 LL |     pub static S: Priv = Priv;
17    |     ^^^^^^^^^^^^^^^^^^ can't leak private type
18
19 error[E0446]: private type `types::Priv` in public interface
20   --> $DIR/private-in-public.rs:15:5
21    |
22 LL |     struct Priv;
23    |     ----------- `types::Priv` declared as private
24 ...
25 LL |     pub fn f1(arg: Priv) {}
26    |     ^^^^^^^^^^^^^^^^^^^^ can't leak private type
27
28 error[E0446]: private type `types::Priv` in public interface
29   --> $DIR/private-in-public.rs:16:5
30    |
31 LL |     struct Priv;
32    |     ----------- `types::Priv` declared as private
33 ...
34 LL |     pub fn f2() -> Priv { panic!() }
35    |     ^^^^^^^^^^^^^^^^^^^ can't leak private type
36
37 error[E0446]: private type `types::Priv` in public interface
38   --> $DIR/private-in-public.rs:17:19
39    |
40 LL |     struct Priv;
41    |     ----------- `types::Priv` declared as private
42 ...
43 LL |     pub struct S1(pub Priv);
44    |                   ^^^^^^^^ can't leak private type
45
46 error[E0446]: private type `types::Priv` in public interface
47   --> $DIR/private-in-public.rs:18:21
48    |
49 LL |     struct Priv;
50    |     ----------- `types::Priv` declared as private
51 ...
52 LL |     pub struct S2 { pub field: Priv }
53    |                     ^^^^^^^^^^^^^^^ can't leak private type
54
55 error[E0446]: private type `types::Priv` in public interface
56   --> $DIR/private-in-public.rs:20:9
57    |
58 LL |     struct Priv;
59    |     ----------- `types::Priv` declared as private
60 ...
61 LL |         pub const C: Priv = Priv;
62    |         ^^^^^^^^^^^^^^^^^ can't leak private type
63
64 error[E0446]: private type `types::Priv` in public interface
65   --> $DIR/private-in-public.rs:21:9
66    |
67 LL |     struct Priv;
68    |     ----------- `types::Priv` declared as private
69 ...
70 LL |         pub fn f1(arg: Priv) {}
71    |         ^^^^^^^^^^^^^^^^^^^^ can't leak private type
72
73 error[E0446]: private type `types::Priv` in public interface
74   --> $DIR/private-in-public.rs:22:9
75    |
76 LL |     struct Priv;
77    |     ----------- `types::Priv` declared as private
78 ...
79 LL |         pub fn f2() -> Priv { panic!() }
80    |         ^^^^^^^^^^^^^^^^^^^ can't leak private type
81
82 error[E0445]: private trait `traits::PrivTr` in public interface
83   --> $DIR/private-in-public.rs:31:5
84    |
85 LL |     trait PrivTr {}
86    |     ------------ `traits::PrivTr` declared as private
87 ...
88 LL |     pub enum E<T: PrivTr> { V(T) }
89    |     ^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
90
91 error[E0445]: private trait `traits::PrivTr` in public interface
92   --> $DIR/private-in-public.rs:32:5
93    |
94 LL |     trait PrivTr {}
95    |     ------------ `traits::PrivTr` declared as private
96 ...
97 LL |     pub fn f<T: PrivTr>(arg: T) {}
98    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
99
100 error[E0445]: private trait `traits::PrivTr` in public interface
101   --> $DIR/private-in-public.rs:33:5
102    |
103 LL |     trait PrivTr {}
104    |     ------------ `traits::PrivTr` declared as private
105 ...
106 LL |     pub struct S1<T: PrivTr>(T);
107    |     ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
108
109 error[E0445]: private trait `traits::PrivTr` in public interface
110   --> $DIR/private-in-public.rs:34:5
111    |
112 LL |     trait PrivTr {}
113    |     ------------ `traits::PrivTr` declared as private
114 ...
115 LL |     impl<T: PrivTr> Pub<T> {
116    |     ^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
117
118 error[E0445]: private trait `traits::PrivTr` in public interface
119   --> $DIR/private-in-public.rs:35:9
120    |
121 LL |     trait PrivTr {}
122    |     ------------ `traits::PrivTr` declared as private
123 ...
124 LL |         pub fn f<U: PrivTr>(arg: U) {}
125    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
126
127 error[E0445]: private trait `traits_where::PrivTr` in public interface
128   --> $DIR/private-in-public.rs:44:5
129    |
130 LL |     trait PrivTr {}
131    |     ------------ `traits_where::PrivTr` declared as private
132 ...
133 LL |     pub enum E<T> where T: PrivTr { V(T) }
134    |     ^^^^^^^^^^^^^ can't leak private trait
135
136 error[E0445]: private trait `traits_where::PrivTr` in public interface
137   --> $DIR/private-in-public.rs:46:5
138    |
139 LL |     trait PrivTr {}
140    |     ------------ `traits_where::PrivTr` declared as private
141 ...
142 LL |     pub fn f<T>(arg: T) where T: PrivTr {}
143    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
144
145 error[E0445]: private trait `traits_where::PrivTr` in public interface
146   --> $DIR/private-in-public.rs:48:5
147    |
148 LL |     trait PrivTr {}
149    |     ------------ `traits_where::PrivTr` declared as private
150 ...
151 LL |     pub struct S1<T>(T) where T: PrivTr;
152    |     ^^^^^^^^^^^^^^^^ can't leak private trait
153
154 error[E0445]: private trait `traits_where::PrivTr` in public interface
155   --> $DIR/private-in-public.rs:50:5
156    |
157 LL |     trait PrivTr {}
158    |     ------------ `traits_where::PrivTr` declared as private
159 ...
160 LL |     impl<T> Pub<T> where T: PrivTr {
161    |     ^^^^^^^^^^^^^^ can't leak private trait
162
163 error[E0445]: private trait `traits_where::PrivTr` in public interface
164   --> $DIR/private-in-public.rs:52:9
165    |
166 LL |     trait PrivTr {}
167    |     ------------ `traits_where::PrivTr` declared as private
168 ...
169 LL |         pub fn f<U>(arg: U) where U: PrivTr {}
170    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
171
172 error[E0446]: private type `generics::Priv` in public interface
173   --> $DIR/private-in-public.rs:63:5
174    |
175 LL |     struct Priv<T = u8>(T);
176    |     ------------------- `generics::Priv` declared as private
177 ...
178 LL |     pub fn f1(arg: [Priv; 1]) {}
179    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
180
181 error[E0446]: private type `generics::Priv` in public interface
182   --> $DIR/private-in-public.rs:64:5
183    |
184 LL |     struct Priv<T = u8>(T);
185    |     ------------------- `generics::Priv` declared as private
186 ...
187 LL |     pub fn f2(arg: Pub<Priv>) {}
188    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
189
190 error[E0446]: private type `generics::Priv<generics::Pub>` in public interface
191   --> $DIR/private-in-public.rs:65:5
192    |
193 LL |     struct Priv<T = u8>(T);
194    |     ------------------- `generics::Priv<generics::Pub>` declared as private
195 ...
196 LL |     pub fn f3(arg: Priv<Pub>) {}
197    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
198
199 error[E0446]: private type `impls::Priv` in public interface
200   --> $DIR/private-in-public.rs:80:9
201    |
202 LL |     struct Priv;
203    |     ----------- `impls::Priv` declared as private
204 ...
205 LL |         pub fn f(arg: Priv) {}
206    |         ^^^^^^^^^^^^^^^^^^^ can't leak private type
207
208 error[E0445]: private trait `aliases_pub::PrivTr` in public interface
209   --> $DIR/private-in-public.rs:104:5
210    |
211 LL |     trait PrivTr {
212    |     ------------ `aliases_pub::PrivTr` declared as private
213 ...
214 LL |     pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
215    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
216
217 error[E0446]: private type `aliases_pub::Priv` in public interface
218   --> $DIR/private-in-public.rs:104:5
219    |
220 LL |     struct Priv;
221    |     ----------- `aliases_pub::Priv` declared as private
222 ...
223 LL |     pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
224    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
225
226 error[E0446]: private type `aliases_pub::Priv` in public interface
227   --> $DIR/private-in-public.rs:109:9
228    |
229 LL |     struct Priv;
230    |     ----------- `aliases_pub::Priv` declared as private
231 ...
232 LL |         pub fn f(arg: Priv) {}
233    |         ^^^^^^^^^^^^^^^^^^^ can't leak private type
234
235 error[E0446]: private type `Priv1` in public interface
236   --> $DIR/private-in-public.rs:131:5
237    |
238 LL |     struct Priv1;
239    |     ------------ `Priv1` declared as private
240 ...
241 LL |     pub fn f1(arg: PrivUseAlias) {}
242    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
243
244 error[E0446]: private type `Priv2` in public interface
245   --> $DIR/private-in-public.rs:132:5
246    |
247 LL |     struct Priv2;
248    |     ------------ `Priv2` declared as private
249 ...
250 LL |     pub fn f2(arg: PrivAlias) {}
251    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
252
253 error[E0445]: private trait `aliases_priv::PrivTr` in public interface
254   --> $DIR/private-in-public.rs:133:5
255    |
256 LL |     trait PrivTr {
257    |     ------------ `aliases_priv::PrivTr` declared as private
258 ...
259 LL |     pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
260    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
261
262 error[E0446]: private type `aliases_priv::Priv` in public interface
263   --> $DIR/private-in-public.rs:133:5
264    |
265 LL |     struct Priv;
266    |     ----------- `aliases_priv::Priv` declared as private
267 ...
268 LL |     pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
269    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
270
271 error[E0446]: private type `aliases_params::Priv` in public interface
272   --> $DIR/private-in-public.rs:143:5
273    |
274 LL |     struct Priv;
275    |     ----------- `aliases_params::Priv` declared as private
276 ...
277 LL |     pub fn f2(arg: PrivAliasGeneric) {}
278    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
279
280 error[E0446]: private type `aliases_params::Priv` in public interface
281   --> $DIR/private-in-public.rs:145:5
282    |
283 LL |     struct Priv;
284    |     ----------- `aliases_params::Priv` declared as private
285 ...
286 LL |     pub fn f3(arg: Result<u8>) {}
287    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
288
289 error: aborting due to 32 previous errors
290
291 Some errors have detailed explanations: E0445, E0446.
292 For more information about an error, try `rustc --explain E0445`.