Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private type in public interface rules do not prevent exposure of some types #23621

Closed
nrc opened this issue Mar 22, 2015 · 2 comments
Closed
Labels
A-resolve Area: Path resolution A-visibility Area: Visibility / privacy.

Comments

@nrc
Copy link
Member

nrc commented Mar 22, 2015

e.g.,

mod B {
    pub use self::A::foo;

    mod A {
        pub struct X;
        pub fn foo(_: X) {}
    }
}

From outside B, foo is visible, but X is not.

The fix is discussed here and in the following comments.

I guess this is technically a backwards incompatible change, but I would regard any example of it as a bug, so I would not feel bad fixing this post 1.0 (also the fix is really easy if we do break your code - just add pub). Still, nominating triage: I-nominated

(example by @tomaka from #23585)

@nrc nrc added A-resolve Area: Path resolution A-visibility Area: Visibility / privacy. labels Mar 22, 2015
@nikomatsakis
Copy link
Contributor

The RFC did not try to prevent this case

@nrc
Copy link
Member Author

nrc commented Mar 24, 2015

As discussed in the RFC, we try to prevent private items in public signatures, not types which are not visible, it was decided that the latter was too difficult. So, this is not a bug. Closing.

@nrc nrc closed this as completed Mar 24, 2015
@nrc nrc removed the I-nominated label Mar 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Path resolution A-visibility Area: Visibility / privacy.
Projects
None yet
Development

No branches or pull requests

3 participants