We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
mod m1 { struct A; pub fn x() -> A { A } } fn main() { let x=m1::x(); println!("{:?}",&x as *const _ as *const u8); }
This generates an error:
<anon>:3:16: 3:17 error: private type in exported type signature [E0446] <anon>:3 pub fn x() -> A { A } ^
Yet this compiles fine:
mod m1 { mod m2 { pub struct A; } use self::m2::A as A; pub fn x() -> A { A } } fn main() { let x=m1::x(); println!("{:?}",&x as *const _ as *const u8); }
However, one is unable to specify the return type of m1::x() outside of m1.
m1::x()
m1