@@ -194,41 +194,8 @@ note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
194
194
LL | trait PrivTr {}
195
195
| ^^^^^^^^^^^^
196
196
197
- error: trait `traits::PrivTr` is more private than the item `traits::Tr3::g::{anon_assoc#0}`
198
- --> $DIR/private-in-public-warn.rs:51:19
199
- |
200
- LL | fn g() -> impl PrivTr;
201
- | ^^^^^^^^^^^ opaque type `traits::Tr3::g::{anon_assoc#0}` is reachable at visibility `pub(crate)`
202
- |
203
- note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
204
- --> $DIR/private-in-public-warn.rs:37:5
205
- |
206
- LL | trait PrivTr {}
207
- | ^^^^^^^^^^^^
208
-
209
- error[E0446]: private trait `traits::PrivTr` in public interface
210
- --> $DIR/private-in-public-warn.rs:53:19
211
- |
212
- LL | trait PrivTr {}
213
- | ------------ `traits::PrivTr` declared as private
214
- ...
215
- LL | fn h() -> impl PrivTr {}
216
- | ^^^^^^^^^^^ can't leak private trait
217
-
218
- error: trait `traits::PrivTr` is more private than the item `traits::Tr3::h::{anon_assoc#0}`
219
- --> $DIR/private-in-public-warn.rs:53:19
220
- |
221
- LL | fn h() -> impl PrivTr {}
222
- | ^^^^^^^^^^^ opaque type `traits::Tr3::h::{anon_assoc#0}` is reachable at visibility `pub(crate)`
223
- |
224
- note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
225
- --> $DIR/private-in-public-warn.rs:37:5
226
- |
227
- LL | trait PrivTr {}
228
- | ^^^^^^^^^^^^
229
-
230
197
error: trait `traits::PrivTr` is more private than the item `traits::Pub<T>`
231
- --> $DIR/private-in-public-warn.rs:57 :5
198
+ --> $DIR/private-in-public-warn.rs:54 :5
232
199
|
233
200
LL | impl<T: PrivTr> Pub<T> {}
234
201
| ^^^^^^^^^^^^^^^^^^^^^^ implementation `traits::Pub<T>` is reachable at visibility `pub(crate)`
@@ -240,169 +207,103 @@ LL | trait PrivTr {}
240
207
| ^^^^^^^^^^^^
241
208
242
209
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Alias`
243
- --> $DIR/private-in-public-warn.rs:66 :5
210
+ --> $DIR/private-in-public-warn.rs:63 :5
244
211
|
245
212
LL | pub type Alias<T> where T: PrivTr = T;
246
213
| ^^^^^^^^^^^^^^^^^ type alias `traits_where::Alias` is reachable at visibility `pub(crate)`
247
214
|
248
215
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
249
- --> $DIR/private-in-public-warn.rs:62 :5
216
+ --> $DIR/private-in-public-warn.rs:59 :5
250
217
|
251
218
LL | trait PrivTr {}
252
219
| ^^^^^^^^^^^^
253
220
254
221
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Tr2`
255
- --> $DIR/private-in-public-warn.rs:69 :5
222
+ --> $DIR/private-in-public-warn.rs:66 :5
256
223
|
257
224
LL | pub trait Tr2<T> where T: PrivTr {}
258
225
| ^^^^^^^^^^^^^^^^ trait `traits_where::Tr2` is reachable at visibility `pub(crate)`
259
226
|
260
227
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
261
- --> $DIR/private-in-public-warn.rs:62 :5
228
+ --> $DIR/private-in-public-warn.rs:59 :5
262
229
|
263
230
LL | trait PrivTr {}
264
231
| ^^^^^^^^^^^^
265
232
266
233
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Tr3::f`
267
- --> $DIR/private-in-public-warn.rs:72 :9
234
+ --> $DIR/private-in-public-warn.rs:69 :9
268
235
|
269
236
LL | fn f<T>(arg: T) where T: PrivTr {}
270
237
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits_where::Tr3::f` is reachable at visibility `pub(crate)`
271
238
|
272
239
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
273
- --> $DIR/private-in-public-warn.rs:62 :5
240
+ --> $DIR/private-in-public-warn.rs:59 :5
274
241
|
275
242
LL | trait PrivTr {}
276
243
| ^^^^^^^^^^^^
277
244
278
245
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Pub<T>`
279
- --> $DIR/private-in-public-warn.rs:75 :5
246
+ --> $DIR/private-in-public-warn.rs:72 :5
280
247
|
281
248
LL | impl<T> Pub<T> where T: PrivTr {}
282
249
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation `traits_where::Pub<T>` is reachable at visibility `pub(crate)`
283
250
|
284
251
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
285
- --> $DIR/private-in-public-warn.rs:62 :5
252
+ --> $DIR/private-in-public-warn.rs:59 :5
286
253
|
287
254
LL | trait PrivTr {}
288
255
| ^^^^^^^^^^^^
289
256
290
257
error: trait `generics::PrivTr<generics::Pub>` is more private than the item `generics::Tr1`
291
- --> $DIR/private-in-public-warn.rs:87 :5
258
+ --> $DIR/private-in-public-warn.rs:84 :5
292
259
|
293
260
LL | pub trait Tr1: PrivTr<Pub> {}
294
261
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr1` is reachable at visibility `pub(crate)`
295
262
|
296
263
note: but trait `generics::PrivTr<generics::Pub>` is only usable at visibility `pub(self)`
297
- --> $DIR/private-in-public-warn.rs:83 :5
264
+ --> $DIR/private-in-public-warn.rs:80 :5
298
265
|
299
266
LL | trait PrivTr<T> {}
300
267
| ^^^^^^^^^^^^^^^
301
268
302
269
error: type `generics::Priv` is more private than the item `generics::Tr2`
303
- --> $DIR/private-in-public-warn.rs:89 :5
270
+ --> $DIR/private-in-public-warn.rs:86 :5
304
271
|
305
272
LL | pub trait Tr2: PubTr<Priv> {}
306
273
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr2` is reachable at visibility `pub(crate)`
307
274
|
308
275
note: but type `generics::Priv` is only usable at visibility `pub(self)`
309
- --> $DIR/private-in-public-warn.rs:81 :5
276
+ --> $DIR/private-in-public-warn.rs:78 :5
310
277
|
311
278
LL | struct Priv<T = u8>(T);
312
279
| ^^^^^^^^^^^^^^^^^^^
313
280
314
281
error: type `generics::Priv` is more private than the item `generics::Tr3`
315
- --> $DIR/private-in-public-warn.rs:90 :5
282
+ --> $DIR/private-in-public-warn.rs:87 :5
316
283
|
317
284
LL | pub trait Tr3: PubTr<[Priv; 1]> {}
318
285
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr3` is reachable at visibility `pub(crate)`
319
286
|
320
287
note: but type `generics::Priv` is only usable at visibility `pub(self)`
321
- --> $DIR/private-in-public-warn.rs:81 :5
288
+ --> $DIR/private-in-public-warn.rs:78 :5
322
289
|
323
290
LL | struct Priv<T = u8>(T);
324
291
| ^^^^^^^^^^^^^^^^^^^
325
292
326
293
error: type `generics::Priv` is more private than the item `Tr4`
327
- --> $DIR/private-in-public-warn.rs:91 :5
294
+ --> $DIR/private-in-public-warn.rs:88 :5
328
295
|
329
296
LL | pub trait Tr4: PubTr<Pub<Priv>> {}
330
297
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `Tr4` is reachable at visibility `pub(crate)`
331
298
|
332
299
note: but type `generics::Priv` is only usable at visibility `pub(self)`
333
- --> $DIR/private-in-public-warn.rs:81:5
334
- |
335
- LL | struct Priv<T = u8>(T);
336
- | ^^^^^^^^^^^^^^^^^^^
337
-
338
- error: trait `generics::PrivTr<generics::Priv<()>>` is more private than the item `Tr5::required::{anon_assoc#0}`
339
- --> $DIR/private-in-public-warn.rs:94:26
340
- |
341
- LL | fn required() -> impl PrivTr<Priv<()>>;
342
- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::required::{anon_assoc#0}` is reachable at visibility `pub(crate)`
343
- |
344
- note: but trait `generics::PrivTr<generics::Priv<()>>` is only usable at visibility `pub(self)`
345
- --> $DIR/private-in-public-warn.rs:83:5
346
- |
347
- LL | trait PrivTr<T> {}
348
- | ^^^^^^^^^^^^^^^
349
-
350
- error: type `generics::Priv<()>` is more private than the item `Tr5::required::{anon_assoc#0}`
351
- --> $DIR/private-in-public-warn.rs:94:26
352
- |
353
- LL | fn required() -> impl PrivTr<Priv<()>>;
354
- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::required::{anon_assoc#0}` is reachable at visibility `pub(crate)`
355
- |
356
- note: but type `generics::Priv<()>` is only usable at visibility `pub(self)`
357
- --> $DIR/private-in-public-warn.rs:81:5
358
- |
359
- LL | struct Priv<T = u8>(T);
360
- | ^^^^^^^^^^^^^^^^^^^
361
-
362
- error[E0446]: private trait `generics::PrivTr<generics::Priv<()>>` in public interface
363
- --> $DIR/private-in-public-warn.rs:97:26
364
- |
365
- LL | trait PrivTr<T> {}
366
- | --------------- `generics::PrivTr<generics::Priv<()>>` declared as private
367
- ...
368
- LL | fn provided() -> impl PrivTr<Priv<()>> {}
369
- | ^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
370
-
371
- error[E0446]: private type `generics::Priv<()>` in public interface
372
- --> $DIR/private-in-public-warn.rs:97:26
373
- |
374
- LL | struct Priv<T = u8>(T);
375
- | ------------------- `generics::Priv<()>` declared as private
376
- ...
377
- LL | fn provided() -> impl PrivTr<Priv<()>> {}
378
- | ^^^^^^^^^^^^^^^^^^^^^ can't leak private type
379
-
380
- error: trait `generics::PrivTr<generics::Priv<()>>` is more private than the item `Tr5::provided::{anon_assoc#0}`
381
- --> $DIR/private-in-public-warn.rs:97:26
382
- |
383
- LL | fn provided() -> impl PrivTr<Priv<()>> {}
384
- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::provided::{anon_assoc#0}` is reachable at visibility `pub(crate)`
385
- |
386
- note: but trait `generics::PrivTr<generics::Priv<()>>` is only usable at visibility `pub(self)`
387
- --> $DIR/private-in-public-warn.rs:83:5
388
- |
389
- LL | trait PrivTr<T> {}
390
- | ^^^^^^^^^^^^^^^
391
-
392
- error: type `generics::Priv<()>` is more private than the item `Tr5::provided::{anon_assoc#0}`
393
- --> $DIR/private-in-public-warn.rs:97:26
394
- |
395
- LL | fn provided() -> impl PrivTr<Priv<()>> {}
396
- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::provided::{anon_assoc#0}` is reachable at visibility `pub(crate)`
397
- |
398
- note: but type `generics::Priv<()>` is only usable at visibility `pub(self)`
399
- --> $DIR/private-in-public-warn.rs:81:5
300
+ --> $DIR/private-in-public-warn.rs:78:5
400
301
|
401
302
LL | struct Priv<T = u8>(T);
402
303
| ^^^^^^^^^^^^^^^^^^^
403
304
404
305
error[E0446]: private type `impls::Priv` in public interface
405
- --> $DIR/private-in-public-warn.rs:128 :9
306
+ --> $DIR/private-in-public-warn.rs:119 :9
406
307
|
407
308
LL | struct Priv;
408
309
| ----------- `impls::Priv` declared as private
@@ -411,19 +312,19 @@ LL | type Alias = Priv;
411
312
| ^^^^^^^^^^ can't leak private type
412
313
413
314
error: type `aliases_pub::Priv` is more private than the item `aliases_pub::<impl Pub2>::f`
414
- --> $DIR/private-in-public-warn.rs:199 :9
315
+ --> $DIR/private-in-public-warn.rs:190 :9
415
316
|
416
317
LL | pub fn f(arg: Priv) {}
417
318
| ^^^^^^^^^^^^^^^^^^^ associated function `aliases_pub::<impl Pub2>::f` is reachable at visibility `pub(crate)`
418
319
|
419
320
note: but type `aliases_pub::Priv` is only usable at visibility `pub(self)`
420
- --> $DIR/private-in-public-warn.rs:172 :5
321
+ --> $DIR/private-in-public-warn.rs:163 :5
421
322
|
422
323
LL | struct Priv;
423
324
| ^^^^^^^^^^^
424
325
425
326
error[E0446]: private type `aliases_pub::Priv` in public interface
426
- --> $DIR/private-in-public-warn.rs:202 :9
327
+ --> $DIR/private-in-public-warn.rs:193 :9
427
328
|
428
329
LL | struct Priv;
429
330
| ----------- `aliases_pub::Priv` declared as private
@@ -432,7 +333,7 @@ LL | type Check = Priv;
432
333
| ^^^^^^^^^^ can't leak private type
433
334
434
335
error[E0446]: private type `aliases_pub::Priv` in public interface
435
- --> $DIR/private-in-public-warn.rs:205 :9
336
+ --> $DIR/private-in-public-warn.rs:196 :9
436
337
|
437
338
LL | struct Priv;
438
339
| ----------- `aliases_pub::Priv` declared as private
@@ -441,7 +342,7 @@ LL | type Check = Priv;
441
342
| ^^^^^^^^^^ can't leak private type
442
343
443
344
error[E0446]: private type `aliases_pub::Priv` in public interface
444
- --> $DIR/private-in-public-warn.rs:208 :9
345
+ --> $DIR/private-in-public-warn.rs:199 :9
445
346
|
446
347
LL | struct Priv;
447
348
| ----------- `aliases_pub::Priv` declared as private
@@ -450,7 +351,7 @@ LL | type Check = Priv;
450
351
| ^^^^^^^^^^ can't leak private type
451
352
452
353
error[E0446]: private type `aliases_pub::Priv` in public interface
453
- --> $DIR/private-in-public-warn.rs:211 :9
354
+ --> $DIR/private-in-public-warn.rs:202 :9
454
355
|
455
356
LL | struct Priv;
456
357
| ----------- `aliases_pub::Priv` declared as private
@@ -459,37 +360,37 @@ LL | type Check = Priv;
459
360
| ^^^^^^^^^^ can't leak private type
460
361
461
362
error: trait `PrivTr1` is more private than the item `aliases_priv::Tr1`
462
- --> $DIR/private-in-public-warn.rs:241 :5
363
+ --> $DIR/private-in-public-warn.rs:232 :5
463
364
|
464
365
LL | pub trait Tr1: PrivUseAliasTr {}
465
366
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr1` is reachable at visibility `pub(crate)`
466
367
|
467
368
note: but trait `PrivTr1` is only usable at visibility `pub(self)`
468
- --> $DIR/private-in-public-warn.rs:227 :5
369
+ --> $DIR/private-in-public-warn.rs:218 :5
469
370
|
470
371
LL | trait PrivTr1<T = u8> {
471
372
| ^^^^^^^^^^^^^^^^^^^^^
472
373
473
374
error: trait `PrivTr1<Priv2>` is more private than the item `aliases_priv::Tr2`
474
- --> $DIR/private-in-public-warn.rs:243 :5
375
+ --> $DIR/private-in-public-warn.rs:234 :5
475
376
|
476
377
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
477
378
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)`
478
379
|
479
380
note: but trait `PrivTr1<Priv2>` is only usable at visibility `pub(self)`
480
- --> $DIR/private-in-public-warn.rs:227 :5
381
+ --> $DIR/private-in-public-warn.rs:218 :5
481
382
|
482
383
LL | trait PrivTr1<T = u8> {
483
384
| ^^^^^^^^^^^^^^^^^^^^^
484
385
485
386
error: type `Priv2` is more private than the item `aliases_priv::Tr2`
486
- --> $DIR/private-in-public-warn.rs:243 :5
387
+ --> $DIR/private-in-public-warn.rs:234 :5
487
388
|
488
389
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
489
390
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)`
490
391
|
491
392
note: but type `Priv2` is only usable at visibility `pub(self)`
492
- --> $DIR/private-in-public-warn.rs:225 :5
393
+ --> $DIR/private-in-public-warn.rs:216 :5
493
394
|
494
395
LL | struct Priv2;
495
396
| ^^^^^^^^^^^^
@@ -509,7 +410,7 @@ LL | pub type Alias<T: PrivTr> = T;
509
410
= note: `#[warn(type_alias_bounds)]` on by default
510
411
511
412
warning: where clauses on type aliases are not enforced
512
- --> $DIR/private-in-public-warn.rs:66 :29
413
+ --> $DIR/private-in-public-warn.rs:63 :29
513
414
|
514
415
LL | pub type Alias<T> where T: PrivTr = T;
515
416
| ------^^^^^^^^^
@@ -521,6 +422,6 @@ LL | pub type Alias<T> where T: PrivTr = T;
521
422
see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
522
423
= help: add `#![feature(lazy_type_alias)]` to the crate attributes to enable the desired semantics
523
424
524
- error: aborting due to 43 previous errors; 2 warnings emitted
425
+ error: aborting due to 34 previous errors; 2 warnings emitted
525
426
526
427
For more information about this error, try `rustc --explain E0446`.
0 commit comments