{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/27608","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/27608/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/27608/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/27608/events","html_url":"https://github.com/rust-lang/rust/issues/27608","id":99833330,"number":27608,"title":"Wrong \"Private type in exported type signature\" error","user":{"login":"netvl","id":280456,"avatar_url":"https://avatars.githubusercontent.com/u/280456?v=3","gravatar_id":"","url":"https://api.github.com/users/netvl","html_url":"https://github.com/netvl","followers_url":"https://api.github.com/users/netvl/followers","following_url":"https://api.github.com/users/netvl/following{/other_user}","gists_url":"https://api.github.com/users/netvl/gists{/gist_id}","starred_url":"https://api.github.com/users/netvl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netvl/subscriptions","organizations_url":"https://api.github.com/users/netvl/orgs","repos_url":"https://api.github.com/users/netvl/repos","events_url":"https://api.github.com/users/netvl/events{/privacy}","received_events_url":"https://api.github.com/users/netvl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-08T21:02:39Z","updated_at":"2015-08-10T19:18:17Z","closed_at":"2015-08-10T19:18:17Z","body":"Consider this code:\r\n```rust\r\nmod a {\r\n    pub mod x {\r\n        pub fn return_x() -> ::X { ::X }\r\n    }\r\n}\r\n\r\nstruct X;\r\n\r\nfn main() {\r\n    let _value = a::x::return_x();\r\n}\r\n```\r\nIt fails to compile with the following error:\r\n```\r\ntest.rs:3:30: 3:33 error: private type in exported type signature\r\ntest.rs:3         pub fn return_x() -> ::X { ::X }\r\n                                       ^~~\r\n```\r\n\r\nHowever, while `fn return_x()` is `pub` and `mod x` is also `pub`, this function never gets exported from the crate because `mod a` is private. Therefore, `X`, being private, is also not available outside the crate. I think that such code should be allowed."}}