Open
Description
There seems to be an issue with detecting the pub
-ness of types on the current nightly (EDIT: and actually stable) branch. Consider the following code:
main.rs
:
mod hardware;
fn main() {
hardware::do_stuff();
}
hardware/mod.rs
:
mod parser;
#[derive(Debug)]
struct Hardware {
foo: u32
}
pub fn do_stuff() {
let hw = parser::get_hardware();
println!("{:?}", hw);
}
hardware/parser.rs
:
use super::Hardware;
pub fn get_hardware() -> Hardware {
Hardware { foo: 5 }
}
There are no public types in the hardware
module that are exposed in any way. Yet, I get this error from the compiler:
[rustc]
private type `hardware::Hardware` in public interface
can't leak private type