Skip to content

impl blocks in private modules visible on a public struct #79876

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

Closed
Subsentient opened this issue Dec 10, 2020 · 4 comments
Closed

impl blocks in private modules visible on a public struct #79876

Subsentient opened this issue Dec 10, 2020 · 4 comments
Labels
C-bug Category: This is a bug.

Comments

@Subsentient
Copy link

Subsentient commented Dec 10, 2020

It seems that if the type is visible, an impl's pub methods can be used, even if such an impl is encased in multiple private modules.

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=bf21f358b4b57075d1243a3b07d93da9

@Subsentient Subsentient added the C-bug Category: This is a bug. label Dec 10, 2020
@jonas-schievink
Copy link
Contributor

This is working as expected, impls are always as public as the type/trait they're for.

@Subsentient
Copy link
Author

Is there anywhere this is documented? I've been looking, I can't find that behaviour listed anywhere.

@jonas-schievink
Copy link
Contributor

Doesn't look like it

@Subsentient
Copy link
Author

Doesn't look like it

Then that's obviously an issue in and of itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants