Open
Description
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.
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
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]Missing/misleading documentation on impl block visibility[/-][+]Document impl block visibility[/+]pierwill commentedon Dec 16, 2020
Would this be something for the API docs here, or the Reference, or both? 🤔
hkBst commentedon Jan 30, 2025
The path to an associated item is any path to the implementing type, followed by the associated item’s identifier as the final path component.Rust reference
I think that would imply that it does not matter where the impl block is, since the path to its items only depends on where the type is defined.
But https://doc.rust-lang.org/std/keyword.impl.html could I think use some clarification.
Rollup merge of rust-lang#136354 - hkBst:patch-34, r=ibraheemdev
Unrolled build for rust-lang#136354
Rollup merge of rust-lang#136354 - hkBst:patch-34, r=ibraheemdev
Rollup merge of rust-lang#136354 - hkBst:patch-34, r=ibraheemdev