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
19 To solve this error, please ensure that the trait is also public. The trait
20 can be made inaccessible if necessary by placing it into a private inner
21 module, but it still has to be marked with `pub`. Example:
24 pub trait Foo { // we set the Foo trait public
28 pub trait Bar : Foo {} // ok!
29 pub struct Bar2<T: Foo>(pub T); // ok!
30 pub fn foo<T: Foo> (t: T) {} // ok!