-
Couldn't load subscription status.
- Fork 13.9k
Description
This is a pre-emptive bug report for when #77820 lands.
mod a {
mod b {
pub(self) struct FooInSelfSuperB;
}
}I expected to see this happen: Rustdoc displays the privacy as written: pub(self) struct FooInSelfSuperB;
Instead, this happened: Rustdoc displays an absolute path: pub(in a::b) struct FooInSelfSuperB;
A similar bug exists for pub(super). The regressions for other paths (pub(super::super) -> pub(crate), pub(in crate::a::b) -> pub(in a::b), etc.) are explicitly not in scope and I don't plan to fix them.
Note that this always requires using --document-private-items.
Implementation Notes
This is not trivial to fix because html::render does not have access to a TyCtxt and impl Clean for ty::Visibility does not have access to the original DefId of the item being documented. impl Clean need to be turned into a free function, and #77820 (comment) needs to be debugged. See jyn514@b997e4f for partial progress on that; feel free to take over that branch if you're interested in fixing this.
Meta
This version of rustdoc has not yet landed; see #77820.