@@ -194,41 +194,8 @@ note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
194194LL |     trait PrivTr {}
195195   |     ^^^^^^^^^^^^
196196
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- 
230197error: 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
232199   |
233200LL |     impl<T: PrivTr> Pub<T> {}
234201   |     ^^^^^^^^^^^^^^^^^^^^^^ implementation `traits::Pub<T>` is reachable at visibility `pub(crate)`
@@ -240,169 +207,103 @@ LL |     trait PrivTr {}
240207   |     ^^^^^^^^^^^^
241208
242209error: 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
244211   |
245212LL |     pub type Alias<T> where T: PrivTr = T;
246213   |     ^^^^^^^^^^^^^^^^^ type alias `traits_where::Alias` is reachable at visibility `pub(crate)`
247214   |
248215note: 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
250217   |
251218LL |     trait PrivTr {}
252219   |     ^^^^^^^^^^^^
253220
254221error: 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
256223   |
257224LL |     pub trait Tr2<T> where T: PrivTr {}
258225   |     ^^^^^^^^^^^^^^^^ trait `traits_where::Tr2` is reachable at visibility `pub(crate)`
259226   |
260227note: 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
262229   |
263230LL |     trait PrivTr {}
264231   |     ^^^^^^^^^^^^
265232
266233error: 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
268235   |
269236LL |         fn f<T>(arg: T) where T: PrivTr {}
270237   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits_where::Tr3::f` is reachable at visibility `pub(crate)`
271238   |
272239note: 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
274241   |
275242LL |     trait PrivTr {}
276243   |     ^^^^^^^^^^^^
277244
278245error: 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
280247   |
281248LL |     impl<T> Pub<T> where T: PrivTr {}
282249   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation `traits_where::Pub<T>` is reachable at visibility `pub(crate)`
283250   |
284251note: 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
286253   |
287254LL |     trait PrivTr {}
288255   |     ^^^^^^^^^^^^
289256
290257error: 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
292259   |
293260LL |     pub trait Tr1: PrivTr<Pub> {}
294261   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr1` is reachable at visibility `pub(crate)`
295262   |
296263note: 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
298265   |
299266LL |     trait PrivTr<T> {}
300267   |     ^^^^^^^^^^^^^^^
301268
302269error: 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
304271   |
305272LL |     pub trait Tr2: PubTr<Priv> {}
306273   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr2` is reachable at visibility `pub(crate)`
307274   |
308275note: 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
310277   |
311278LL |     struct Priv<T = u8>(T);
312279   |     ^^^^^^^^^^^^^^^^^^^
313280
314281error: 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
316283   |
317284LL |     pub trait Tr3: PubTr<[Priv; 1]> {}
318285   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr3` is reachable at visibility `pub(crate)`
319286   |
320287note: 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
322289   |
323290LL |     struct Priv<T = u8>(T);
324291   |     ^^^^^^^^^^^^^^^^^^^
325292
326293error: 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
328295   |
329296LL |     pub trait Tr4: PubTr<Pub<Priv>> {}
330297   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `Tr4` is reachable at visibility `pub(crate)`
331298   |
332299note: 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
400301   |
401302LL |     struct Priv<T = u8>(T);
402303   |     ^^^^^^^^^^^^^^^^^^^
403304
404305error[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
406307   |
407308LL |     struct Priv;
408309   |     ----------- `impls::Priv` declared as private
@@ -411,19 +312,19 @@ LL |         type Alias = Priv;
411312   |         ^^^^^^^^^^ can't leak private type
412313
413314error: 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
415316   |
416317LL |         pub fn f(arg: Priv) {}
417318   |         ^^^^^^^^^^^^^^^^^^^ associated function `aliases_pub::<impl Pub2>::f` is reachable at visibility `pub(crate)`
418319   |
419320note: 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
421322   |
422323LL |     struct Priv;
423324   |     ^^^^^^^^^^^
424325
425326error[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
427328   |
428329LL |     struct Priv;
429330   |     ----------- `aliases_pub::Priv` declared as private
@@ -432,7 +333,7 @@ LL |         type Check = Priv;
432333   |         ^^^^^^^^^^ can't leak private type
433334
434335error[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
436337   |
437338LL |     struct Priv;
438339   |     ----------- `aliases_pub::Priv` declared as private
@@ -441,7 +342,7 @@ LL |         type Check = Priv;
441342   |         ^^^^^^^^^^ can't leak private type
442343
443344error[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
445346   |
446347LL |     struct Priv;
447348   |     ----------- `aliases_pub::Priv` declared as private
@@ -450,7 +351,7 @@ LL |         type Check = Priv;
450351   |         ^^^^^^^^^^ can't leak private type
451352
452353error[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
454355   |
455356LL |     struct Priv;
456357   |     ----------- `aliases_pub::Priv` declared as private
@@ -459,37 +360,37 @@ LL |         type Check = Priv;
459360   |         ^^^^^^^^^^ can't leak private type
460361
461362error: 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
463364   |
464365LL |     pub trait Tr1: PrivUseAliasTr {}
465366   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr1` is reachable at visibility `pub(crate)`
466367   |
467368note: 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
469370   |
470371LL |     trait PrivTr1<T = u8> {
471372   |     ^^^^^^^^^^^^^^^^^^^^^
472373
473374error: 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
475376   |
476377LL |     pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
477378   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)`
478379   |
479380note: 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
481382   |
482383LL |     trait PrivTr1<T = u8> {
483384   |     ^^^^^^^^^^^^^^^^^^^^^
484385
485386error: 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
487388   |
488389LL |     pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
489390   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)`
490391   |
491392note: 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
493394   |
494395LL |     struct Priv2;
495396   |     ^^^^^^^^^^^^
@@ -509,7 +410,7 @@ LL |     pub type Alias<T: PrivTr> = T;
509410   = note: `#[warn(type_alias_bounds)]` on by default
510411
511412warning: 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
513414   |
514415LL |     pub type Alias<T> where T: PrivTr = T;
515416   |                       ------^^^^^^^^^
@@ -521,6 +422,6 @@ LL |     pub type Alias<T> where T: PrivTr = T;
521422           see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
522423   = help: add `#![feature(lazy_type_alias)]` to the crate attributes to enable the desired semantics
523424
524- error: aborting due to 43  previous errors; 2 warnings emitted
425+ error: aborting due to 34  previous errors; 2 warnings emitted
525426
526427For more information about this error, try `rustc --explain E0446`.
0 commit comments