error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:24:1 | LL | trait PrivTr {} | ------------ `PrivTr` declared as private ... LL | pub struct S | ^^^^^^^^^^^^ can't leak private trait warning: trait `PrivTr` is more private than the item `S` --> $DIR/where-pub-type-impls-priv-trait.rs:24:1 | LL | pub struct S | ^^^^^^^^^^^^ struct `S` is reachable at visibility `pub` | note: but trait `PrivTr` is only usable at visibility `pub(crate)` --> $DIR/where-pub-type-impls-priv-trait.rs:14:1 | LL | trait PrivTr {} | ^^^^^^^^^^^^ note: the lint level is defined here --> $DIR/where-pub-type-impls-priv-trait.rs:7:9 | LL | #![warn(private_bounds)] | ^^^^^^^^^^^^^^ error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:32:1 | LL | trait PrivTr {} | ------------ `PrivTr` declared as private ... LL | pub enum E | ^^^^^^^^^^ can't leak private trait warning: trait `PrivTr` is more private than the item `E` --> $DIR/where-pub-type-impls-priv-trait.rs:32:1 | LL | pub enum E | ^^^^^^^^^^ enum `E` is reachable at visibility `pub` | note: but trait `PrivTr` is only usable at visibility `pub(crate)` --> $DIR/where-pub-type-impls-priv-trait.rs:14:1 | LL | trait PrivTr {} | ^^^^^^^^^^^^ error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:40:1 | LL | trait PrivTr {} | ------------ `PrivTr` declared as private ... LL | / pub fn f() LL | | LL | | LL | | where LL | | PubTy: PrivTr | |_________________^ can't leak private trait warning: trait `PrivTr` is more private than the item `f` --> $DIR/where-pub-type-impls-priv-trait.rs:40:1 | LL | / pub fn f() LL | | LL | | LL | | where LL | | PubTy: PrivTr | |_________________^ function `f` is reachable at visibility `pub` | note: but trait `PrivTr` is only usable at visibility `pub(crate)` --> $DIR/where-pub-type-impls-priv-trait.rs:14:1 | LL | trait PrivTr {} | ^^^^^^^^^^^^ error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:48:1 | LL | trait PrivTr {} | ------------ `PrivTr` declared as private ... LL | impl S | ^^^^^^ can't leak private trait warning: trait `PrivTr` is more private than the item `S` --> $DIR/where-pub-type-impls-priv-trait.rs:48:1 | LL | impl S | ^^^^^^ implementation `S` is reachable at visibility `pub` | note: but trait `PrivTr` is only usable at visibility `pub(crate)` --> $DIR/where-pub-type-impls-priv-trait.rs:14:1 | LL | trait PrivTr {} | ^^^^^^^^^^^^ error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:54:5 | LL | trait PrivTr {} | ------------ `PrivTr` declared as private ... LL | / pub fn f() LL | | LL | | LL | | where LL | | PubTy: PrivTr | |_____________________^ can't leak private trait warning: trait `PrivTr` is more private than the item `S::f` --> $DIR/where-pub-type-impls-priv-trait.rs:54:5 | LL | / pub fn f() LL | | LL | | LL | | where LL | | PubTy: PrivTr | |_____________________^ associated function `S::f` is reachable at visibility `pub` | note: but trait `PrivTr` is only usable at visibility `pub(crate)` --> $DIR/where-pub-type-impls-priv-trait.rs:14:1 | LL | trait PrivTr {} | ^^^^^^^^^^^^ error: aborting due to 5 previous errors; 5 warnings emitted For more information about this error, try `rustc --explain E0445`.