Closed
Description
openedon Nov 7, 2015
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
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Relevant to the language team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.