1 A private trait was used on a public type parameter bound.
3 Erroneous code examples:
6 #![deny(private_in_public)]
12 pub trait Bar : Foo {} // error: private trait in public interface
13 pub struct Bar2<T: Foo>(pub T); // same error
14 pub fn foo<T: Foo> (t: T) {} // same error
17 To solve this error, please ensure that the trait is also public. The trait
18 can be made inaccessible if necessary by placing it into a private inner
19 module, but it still has to be marked with `pub`. Example:
22 pub trait Foo { // we set the Foo trait public
26 pub trait Bar : Foo {} // ok!
27 pub struct Bar2<T: Foo>(pub T); // ok!
28 pub fn foo<T: Foo> (t: T) {} // ok!