rustdoc: #[doc(hidden)]
associated items of traits re-exported from external crates are not hidden in certain impl
blocks
#95717
Labels
A-cross-crate-reexports
Area: Documentation that has been re-exported from a different crate
C-bug
Category: This is a bug.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Minimal reproducible example (on stable and nightly):
Document crate
beta
and take a look at the generated pages ofTr
andTy
:You should be able to actually see the associated type
Assoc
in theimpl
block despite being marked as hidden. You probably need to click[+]
(expand) first.The
impl
block I refer to is in sectionIt should be noted that even though
Assoc
wrongly shows up in thoseimpl
blocks, it is indeed not shown in the code block at the start of the trait page – at the “definition site” if you will (compared to the “use sites” – theimpl
blocks).It is crucial that the trait and the type are defined inside of an external crate. If they were defined in the “current” crate, this bug would not occur: The hidden associated items would not be shown.
You can check this for yourself by
alpha
on its own and viewing its documentation separately, or byalpha
frombeta
(e.g. withpub use alpha;
) and then documentingbeta
:alpha::Tr
, the associated item is hiddenbeta::Tr
, however, the associated item is displayedI've discovered this bug in a PR of mine after a CI job failed because the linkchecker complained about broken links in the standard library when documenting it with a modified rustdoc. The broken links are not relevant for this bug, they are mere symptoms of it: If everything was properly hidden, no broken links would ever be generated.
This bug currently affects the standard library documentation (for stable and nightly) as mentioned in the linked comment.
In this case,
SupportedLaneCount
LaneCount
BitMask
core
std
@rustbot label T-rustdoc A-cross-crate-reexports
The text was updated successfully, but these errors were encountered: