Closed
Description
struct PrivOuter;
mod m {
struct PrivInner;
impl PrivInner {
pub fn secret(&self) { println!("Hello!"); }
}
// This impl is considered private because its type `super::PrivOuter` is private
// Probably, impls should be considered public if their type is defined outside of the current module even if this type is private
impl super::PrivOuter {
pub fn reveal(&self) -> PrivInner { PrivInner }
}
}
fn main() {
PrivOuter.reveal().secret();
}
This is not fixed in #29973.
It shouldn't be a common scenario, so it can be fixed later.
Metadata
Metadata
Assignees
Labels
No labels