You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.