-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.