Hi!
Today I’ve noticed that the following compiles without warnings:
mod a {
pub use self::b::{make_s, consume_s}; // S is effectively private to a
mod b {
pub struct S;
pub fn make_s() -> S { S }
pub fn consume_s(_: S) { }
}
}
fn main() {
let s = a::make_s();
// typeof(s) == S
a::consume_s(s);
}
Is it supposed to be so? Roughly equivalent code causes public in private error…
mod a {
struct S;
pub fn make_s() -> S { S }
pub fn consume_s(_: S) { }
}
fn main() {
let s = a::make_s();
a::consume_s(s);
}