Skip to content

Document impl block visibility #79878

Open
@Subsentient

Description

@Subsentient

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

I cannot find anywhere in the documentation, hell, even Google, where this behaviour is documented correctly. Only after opening #79876 did I find out that this is the expected behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-visibilityArea: Visibility / privacyC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions