-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Document impl block visibility #79878
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
Comments
Would this be something for the API docs here, or the Reference, or both? 🤔 |
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. |
Update docs for impl keyword This started as a fix for rust-lang#79878, but also introduces some structure (headings), and elaborates a tiny bit on impl Trait syntax.
Rollup merge of rust-lang#136354 - hkBst:patch-34, r=ibraheemdev Update docs for impl keyword This started as a fix for rust-lang#79878, but also introduces some structure (headings), and elaborates a tiny bit on impl Trait syntax.
Update docs for impl keyword This started as a fix for rust-lang#79878, but also introduces some structure (headings), and elaborates a tiny bit on impl Trait syntax.
Update docs for impl keyword This started as a fix for rust-lang#79878, but also introduces some structure (headings), and elaborates a tiny bit on impl Trait syntax.
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.
The text was updated successfully, but these errors were encountered: