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