1 A private type was used in a public type signature.
3 Erroneous code example:
6 #![deny(private_in_public)]
11 pub fn bar() -> Bar { // error: private type in public interface
19 There are two ways to solve this error. The first is to make the public type
20 signature only public to a module that also has access to the private type.
21 This is done by using pub(crate) or pub(in crate::my_mod::etc)
29 pub(crate) fn bar() -> Bar { // only public to crate root
37 The other way to solve this error is to make the private type public.
41 pub struct Bar(u32); // we set the Bar type public
44 pub fn bar() -> Bar { // ok!