You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C-bugCategory: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
Similar to #52545, rustdoc doesn't see anything if it's not written into a module's scope. However, there are some things that can be written in function/expression scope that still make it out into the public API. While that issue was about trait impls, it seems that inherent impls work in a similar way. Consider the following snippet:
fnasdf(){implSomeStruct{pubfnqwop(&self){println!("hidden function");}}}fnmain(){let asdf = SomeStruct;
asdf.qwop();// prints "hidden function"}
Even though qwop() was written in function scope, it's still visible globally because it was defined with pub. Rustdoc should collect these impls and display them.
One thing i'm curious about is whether we should show non-pub functions defined in non-module scope when --document-private-items is set. I think we can get away with it, because it already displays private functions there regardless of where they're defined.
The text was updated successfully, but these errors were encountered:
C-bugCategory: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
Similar to #52545, rustdoc doesn't see anything if it's not written into a module's scope. However, there are some things that can be written in function/expression scope that still make it out into the public API. While that issue was about trait impls, it seems that inherent impls work in a similar way. Consider the following snippet:
Even though
qwop()
was written in function scope, it's still visible globally because it was defined withpub
. Rustdoc should collect these impls and display them.One thing i'm curious about is whether we should show non-
pub
functions defined in non-module scope when--document-private-items
is set. I think we can get away with it, because it already displays private functions there regardless of where they're defined.The text was updated successfully, but these errors were encountered: