@@ -112,7 +112,7 @@ LL | pub type Alias<T: PrivTr> = T; //~ ERROR private trait `traits::PrivTr`
112
112
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
113
113
114
114
error: private trait `traits::PrivTr` in public interface (error E0445)
115
- --> $DIR/private-in-public-warn.rs:52 :5
115
+ --> $DIR/private-in-public-warn.rs:53 :5
116
116
|
117
117
LL | pub trait Tr1: PrivTr {} //~ ERROR private trait `traits::PrivTr` in public interface
118
118
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -121,7 +121,7 @@ LL | pub trait Tr1: PrivTr {} //~ ERROR private trait `traits::PrivTr` in pu
121
121
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
122
122
123
123
error: private trait `traits::PrivTr` in public interface (error E0445)
124
- --> $DIR/private-in-public-warn.rs:54 :5
124
+ --> $DIR/private-in-public-warn.rs:55 :5
125
125
|
126
126
LL | pub trait Tr2<T: PrivTr> {} //~ ERROR private trait `traits::PrivTr` in public interface
127
127
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -130,7 +130,7 @@ LL | pub trait Tr2<T: PrivTr> {} //~ ERROR private trait `traits::PrivTr` in
130
130
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
131
131
132
132
error: private trait `traits::PrivTr` in public interface (error E0445)
133
- --> $DIR/private-in-public-warn.rs:56 :5
133
+ --> $DIR/private-in-public-warn.rs:57 :5
134
134
|
135
135
LL | / pub trait Tr3 {
136
136
LL | | //~^ ERROR private trait `traits::PrivTr` in public interface
@@ -145,7 +145,7 @@ LL | | }
145
145
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
146
146
147
147
error: private trait `traits::PrivTr` in public interface (error E0445)
148
- --> $DIR/private-in-public-warn.rs:60 :9
148
+ --> $DIR/private-in-public-warn.rs:61 :9
149
149
|
150
150
LL | fn f<T: PrivTr>(arg: T) {} //~ ERROR private trait `traits::PrivTr` in public interface
151
151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -154,7 +154,7 @@ LL | fn f<T: PrivTr>(arg: T) {} //~ ERROR private trait `traits::PrivTr`
154
154
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
155
155
156
156
error: private trait `traits::PrivTr` in public interface (error E0445)
157
- --> $DIR/private-in-public-warn.rs:63 :5
157
+ --> $DIR/private-in-public-warn.rs:64 :5
158
158
|
159
159
LL | impl<T: PrivTr> Pub<T> {} //~ ERROR private trait `traits::PrivTr` in public interface
160
160
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -163,7 +163,7 @@ LL | impl<T: PrivTr> Pub<T> {} //~ ERROR private trait `traits::PrivTr` in p
163
163
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
164
164
165
165
error: private trait `traits::PrivTr` in public interface (error E0445)
166
- --> $DIR/private-in-public-warn.rs:65 :5
166
+ --> $DIR/private-in-public-warn.rs:66 :5
167
167
|
168
168
LL | impl<T: PrivTr> PubTr for Pub<T> {} //~ ERROR private trait `traits::PrivTr` in public interface
169
169
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -172,7 +172,7 @@ LL | impl<T: PrivTr> PubTr for Pub<T> {} //~ ERROR private trait `traits::Pr
172
172
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
173
173
174
174
error: private trait `traits_where::PrivTr` in public interface (error E0445)
175
- --> $DIR/private-in-public-warn.rs:74 :5
175
+ --> $DIR/private-in-public-warn.rs:75 :5
176
176
|
177
177
LL | pub type Alias<T> where T: PrivTr = T;
178
178
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -181,7 +181,7 @@ LL | pub type Alias<T> where T: PrivTr = T;
181
181
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
182
182
183
183
error: private trait `traits_where::PrivTr` in public interface (error E0445)
184
- --> $DIR/private-in-public-warn.rs:77 :5
184
+ --> $DIR/private-in-public-warn.rs:79 :5
185
185
|
186
186
LL | pub trait Tr2<T> where T: PrivTr {}
187
187
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -190,7 +190,7 @@ LL | pub trait Tr2<T> where T: PrivTr {}
190
190
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
191
191
192
192
error: private trait `traits_where::PrivTr` in public interface (error E0445)
193
- --> $DIR/private-in-public-warn.rs:81 :9
193
+ --> $DIR/private-in-public-warn.rs:83 :9
194
194
|
195
195
LL | fn f<T>(arg: T) where T: PrivTr {}
196
196
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -199,7 +199,7 @@ LL | fn f<T>(arg: T) where T: PrivTr {}
199
199
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
200
200
201
201
error: private trait `traits_where::PrivTr` in public interface (error E0445)
202
- --> $DIR/private-in-public-warn.rs:85 :5
202
+ --> $DIR/private-in-public-warn.rs:87 :5
203
203
|
204
204
LL | impl<T> Pub<T> where T: PrivTr {}
205
205
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -208,7 +208,7 @@ LL | impl<T> Pub<T> where T: PrivTr {}
208
208
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
209
209
210
210
error: private trait `traits_where::PrivTr` in public interface (error E0445)
211
- --> $DIR/private-in-public-warn.rs:88 :5
211
+ --> $DIR/private-in-public-warn.rs:90 :5
212
212
|
213
213
LL | impl<T> PubTr for Pub<T> where T: PrivTr {}
214
214
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -217,7 +217,7 @@ LL | impl<T> PubTr for Pub<T> where T: PrivTr {}
217
217
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
218
218
219
219
error: private trait `generics::PrivTr<generics::Pub>` in public interface (error E0445)
220
- --> $DIR/private-in-public-warn.rs:99 :5
220
+ --> $DIR/private-in-public-warn.rs:101 :5
221
221
|
222
222
LL | pub trait Tr1: PrivTr<Pub> {}
223
223
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -226,7 +226,7 @@ LL | pub trait Tr1: PrivTr<Pub> {}
226
226
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
227
227
228
228
error: private type `generics::Priv` in public interface (error E0446)
229
- --> $DIR/private-in-public-warn.rs:102 :5
229
+ --> $DIR/private-in-public-warn.rs:104 :5
230
230
|
231
231
LL | pub trait Tr2: PubTr<Priv> {} //~ ERROR private type `generics::Priv` in public interface
232
232
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -235,7 +235,7 @@ LL | pub trait Tr2: PubTr<Priv> {} //~ ERROR private type `generics::Priv` i
235
235
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
236
236
237
237
error: private type `generics::Priv` in public interface (error E0446)
238
- --> $DIR/private-in-public-warn.rs:104 :5
238
+ --> $DIR/private-in-public-warn.rs:106 :5
239
239
|
240
240
LL | pub trait Tr3: PubTr<[Priv; 1]> {} //~ ERROR private type `generics::Priv` in public interface
241
241
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -244,7 +244,7 @@ LL | pub trait Tr3: PubTr<[Priv; 1]> {} //~ ERROR private type `generics::Pr
244
244
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
245
245
246
246
error: private type `generics::Priv` in public interface (error E0446)
247
- --> $DIR/private-in-public-warn.rs:106 :5
247
+ --> $DIR/private-in-public-warn.rs:108 :5
248
248
|
249
249
LL | pub trait Tr4: PubTr<Pub<Priv>> {} //~ ERROR private type `generics::Priv` in public interface
250
250
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -253,7 +253,7 @@ LL | pub trait Tr4: PubTr<Pub<Priv>> {} //~ ERROR private type `generics::Pr
253
253
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
254
254
255
255
error[E0446]: private type `impls::Priv` in public interface
256
- --> $DIR/private-in-public-warn.rs:133 :9
256
+ --> $DIR/private-in-public-warn.rs:135 :9
257
257
|
258
258
LL | struct Priv;
259
259
| - `impls::Priv` declared as private
@@ -262,7 +262,7 @@ LL | type Alias = Priv; //~ ERROR private type `impls::Priv` in public i
262
262
| ^^^^^^^^^^^^^^^^^^ can't leak private type
263
263
264
264
error: private type `aliases_pub::Priv` in public interface (error E0446)
265
- --> $DIR/private-in-public-warn.rs:204 :9
265
+ --> $DIR/private-in-public-warn.rs:206 :9
266
266
|
267
267
LL | pub fn f(arg: Priv) {} //~ ERROR private type `aliases_pub::Priv` in public interface
268
268
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -271,7 +271,7 @@ LL | pub fn f(arg: Priv) {} //~ ERROR private type `aliases_pub::Priv` i
271
271
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
272
272
273
273
error[E0446]: private type `aliases_pub::Priv` in public interface
274
- --> $DIR/private-in-public-warn.rs:208 :9
274
+ --> $DIR/private-in-public-warn.rs:210 :9
275
275
|
276
276
LL | struct Priv;
277
277
| - `aliases_pub::Priv` declared as private
@@ -280,7 +280,7 @@ LL | type Check = Priv; //~ ERROR private type `aliases_pub::Priv` in pu
280
280
| ^^^^^^^^^^^^^^^^^^ can't leak private type
281
281
282
282
error[E0446]: private type `aliases_pub::Priv` in public interface
283
- --> $DIR/private-in-public-warn.rs:211 :9
283
+ --> $DIR/private-in-public-warn.rs:213 :9
284
284
|
285
285
LL | struct Priv;
286
286
| - `aliases_pub::Priv` declared as private
@@ -289,7 +289,7 @@ LL | type Check = Priv; //~ ERROR private type `aliases_pub::Priv` in pu
289
289
| ^^^^^^^^^^^^^^^^^^ can't leak private type
290
290
291
291
error[E0446]: private type `aliases_pub::Priv` in public interface
292
- --> $DIR/private-in-public-warn.rs:214 :9
292
+ --> $DIR/private-in-public-warn.rs:216 :9
293
293
|
294
294
LL | struct Priv;
295
295
| - `aliases_pub::Priv` declared as private
@@ -298,7 +298,7 @@ LL | type Check = Priv; //~ ERROR private type `aliases_pub::Priv` in pu
298
298
| ^^^^^^^^^^^^^^^^^^ can't leak private type
299
299
300
300
error[E0446]: private type `aliases_pub::Priv` in public interface
301
- --> $DIR/private-in-public-warn.rs:217 :9
301
+ --> $DIR/private-in-public-warn.rs:219 :9
302
302
|
303
303
LL | struct Priv;
304
304
| - `aliases_pub::Priv` declared as private
@@ -307,7 +307,7 @@ LL | type Check = Priv; //~ ERROR private type `aliases_pub::Priv` in pu
307
307
| ^^^^^^^^^^^^^^^^^^ can't leak private type
308
308
309
309
error: private trait `aliases_priv::PrivTr1` in public interface (error E0445)
310
- --> $DIR/private-in-public-warn.rs:247 :5
310
+ --> $DIR/private-in-public-warn.rs:249 :5
311
311
|
312
312
LL | pub trait Tr1: PrivUseAliasTr {}
313
313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -316,7 +316,7 @@ LL | pub trait Tr1: PrivUseAliasTr {}
316
316
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
317
317
318
318
error: private trait `aliases_priv::PrivTr1<aliases_priv::Priv2>` in public interface (error E0445)
319
- --> $DIR/private-in-public-warn.rs:250 :5
319
+ --> $DIR/private-in-public-warn.rs:252 :5
320
320
|
321
321
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
322
322
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -325,14 +325,31 @@ LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
325
325
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
326
326
327
327
error: private type `aliases_priv::Priv2` in public interface (error E0446)
328
- --> $DIR/private-in-public-warn.rs:250 :5
328
+ --> $DIR/private-in-public-warn.rs:252 :5
329
329
|
330
330
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
331
331
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
332
332
|
333
333
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
334
334
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
335
335
336
+ warning: bounds on generic parameters are not enforced in type aliases
337
+ --> $DIR/private-in-public-warn.rs:50:23
338
+ |
339
+ LL | pub type Alias<T: PrivTr> = T; //~ ERROR private trait `traits::PrivTr` in public interface
340
+ | ^^^^^^
341
+ |
342
+ = note: #[warn(type_alias_bounds)] on by default
343
+ = help: the bound will not be checked when the type alias is used, and should be removed
344
+
345
+ warning: where clauses are not enforced in type aliases
346
+ --> $DIR/private-in-public-warn.rs:75:29
347
+ |
348
+ LL | pub type Alias<T> where T: PrivTr = T;
349
+ | ^^^^^^^^^
350
+ |
351
+ = help: the clause will not be checked when the type alias is used, and should be removed
352
+
336
353
error: aborting due to 36 previous errors
337
354
338
355
For more information about this error, try `rustc --explain E0446`.
0 commit comments