@@ -194,17 +194,14 @@ 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}`
197+ error[E0446]: private trait `traits::PrivTr` in public interface
198198 --> $DIR/private-in-public-warn.rs:51:19
199199 |
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- |
206200LL | trait PrivTr {}
207- | ^^^^^^^^^^^^
201+ | ------------ `traits::PrivTr` declared as private
202+ ...
203+ LL | fn g() -> impl PrivTr;
204+ | ^^^^^^^^^^^ can't leak private trait
208205
209206error: trait `traits::PrivTr` is more private than the item `traits::Tr3::g::{anon_assoc#0}`
210207 --> $DIR/private-in-public-warn.rs:51:19
@@ -218,17 +215,14 @@ note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
218215LL | trait PrivTr {}
219216 | ^^^^^^^^^^^^
220217
221- error: trait `traits::PrivTr` is more private than the item `traits::Tr3::h::{anon_assoc#0}`
218+ error[E0446]: private trait `traits::PrivTr` in public interface
222219 --> $DIR/private-in-public-warn.rs:54:19
223220 |
224- LL | fn h() -> impl PrivTr {}
225- | ^^^^^^^^^^^ opaque type `traits::Tr3::h::{anon_assoc#0}` is reachable at visibility `pub(crate)`
226- |
227- note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
228- --> $DIR/private-in-public-warn.rs:37:5
229- |
230221LL | trait PrivTr {}
231- | ^^^^^^^^^^^^
222+ | ------------ `traits::PrivTr` declared as private
223+ ...
224+ LL | fn h() -> impl PrivTr {}
225+ | ^^^^^^^^^^^ can't leak private trait
232226
233227error: trait `traits::PrivTr` is more private than the item `traits::Tr3::h::{anon_assoc#0}`
234228 --> $DIR/private-in-public-warn.rs:54:19
@@ -350,29 +344,23 @@ note: but type `generics::Priv` is only usable at visibility `pub(self)`
350344LL | struct Priv<T = u8>(T);
351345 | ^^^^^^^^^^^^^^^^^^^
352346
353- error: trait `generics::PrivTr<generics::Priv<()>>` is more private than the item `Tr5::required::{anon_assoc#0}`
347+ error[E0446]: private trait `generics::PrivTr<generics::Priv<()>>` in public interface
354348 --> $DIR/private-in-public-warn.rs:95:26
355349 |
356- LL | fn required() -> impl PrivTr<Priv<()>>;
357- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::required::{anon_assoc#0}` is reachable at visibility `pub(crate)`
358- |
359- note: but trait `generics::PrivTr<generics::Priv<()>>` is only usable at visibility `pub(self)`
360- --> $DIR/private-in-public-warn.rs:84:5
361- |
362350LL | trait PrivTr<T> {}
363- | ^^^^^^^^^^^^^^^
351+ | --------------- `generics::PrivTr<generics::Priv<()>>` declared as private
352+ ...
353+ LL | fn required() -> impl PrivTr<Priv<()>>;
354+ | ^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
364355
365- error: type `generics::Priv<()>` is more private than the item `Tr5::required::{anon_assoc#0}`
356+ error[E0446]: private type `generics::Priv<()>` in public interface
366357 --> $DIR/private-in-public-warn.rs:95:26
367358 |
368- LL | fn required() -> impl PrivTr<Priv<()>>;
369- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::required::{anon_assoc#0}` is reachable at visibility `pub(crate)`
370- |
371- note: but type `generics::Priv<()>` is only usable at visibility `pub(self)`
372- --> $DIR/private-in-public-warn.rs:82:5
373- |
374359LL | struct Priv<T = u8>(T);
375- | ^^^^^^^^^^^^^^^^^^^
360+ | ------------------- `generics::Priv<()>` declared as private
361+ ...
362+ LL | fn required() -> impl PrivTr<Priv<()>>;
363+ | ^^^^^^^^^^^^^^^^^^^^^ can't leak private type
376364
377365error: trait `generics::PrivTr<generics::Priv<()>>` is more private than the item `Tr5::required::{anon_assoc#0}`
378366 --> $DIR/private-in-public-warn.rs:95:26
@@ -398,29 +386,23 @@ note: but type `generics::Priv<()>` is only usable at visibility `pub(self)`
398386LL | struct Priv<T = u8>(T);
399387 | ^^^^^^^^^^^^^^^^^^^
400388
401- error: trait `generics::PrivTr<generics::Priv<()>>` is more private than the item `Tr5::provided::{anon_assoc#0}`
389+ error[E0446]: private trait `generics::PrivTr<generics::Priv<()>>` in public interface
402390 --> $DIR/private-in-public-warn.rs:100:26
403391 |
404- LL | fn provided() -> impl PrivTr<Priv<()>> {}
405- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::provided::{anon_assoc#0}` is reachable at visibility `pub(crate)`
406- |
407- note: but trait `generics::PrivTr<generics::Priv<()>>` is only usable at visibility `pub(self)`
408- --> $DIR/private-in-public-warn.rs:84:5
409- |
410392LL | trait PrivTr<T> {}
411- | ^^^^^^^^^^^^^^^
393+ | --------------- `generics::PrivTr<generics::Priv<()>>` declared as private
394+ ...
395+ LL | fn provided() -> impl PrivTr<Priv<()>> {}
396+ | ^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
412397
413- error: type `generics::Priv<()>` is more private than the item `Tr5::provided::{anon_assoc#0}`
398+ error[E0446]: private type `generics::Priv<()>` in public interface
414399 --> $DIR/private-in-public-warn.rs:100:26
415400 |
416- LL | fn provided() -> impl PrivTr<Priv<()>> {}
417- | ^^^^^^^^^^^^^^^^^^^^^ opaque type `Tr5::provided::{anon_assoc#0}` is reachable at visibility `pub(crate)`
418- |
419- note: but type `generics::Priv<()>` is only usable at visibility `pub(self)`
420- --> $DIR/private-in-public-warn.rs:82:5
421- |
422401LL | struct Priv<T = u8>(T);
423- | ^^^^^^^^^^^^^^^^^^^
402+ | ------------------- `generics::Priv<()>` declared as private
403+ ...
404+ LL | fn provided() -> impl PrivTr<Priv<()>> {}
405+ | ^^^^^^^^^^^^^^^^^^^^^ can't leak private type
424406
425407error: trait `generics::PrivTr<generics::Priv<()>>` is more private than the item `Tr5::provided::{anon_assoc#0}`
426408 --> $DIR/private-in-public-warn.rs:100:26
0 commit comments