I have some difficulty understanding the below: since foo
is private, isn't the function bar only accessible within the crate anyway? So why is this a violation?
Erroneous code example:
#![deny(private_in_public)]
struct Bar(u32);
mod foo {
use crate::Bar;
pub fn bar() -> Bar { // error: private type in public interface
Bar(0)
}
}