#[doc(cfg(…))]
doesn’t work properly with cross-crate re-exports.
#88743
Labels
A-cross-crate-reexports
Area: Documentation that has been re-exported from a different crate
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
C-bug
Category: This is a bug.
F-doc_cfg
`#![feature(doc_cfg)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Hard to put in words the kind of mess that the situation currently seems to be…
Let’s just look at an example:
Resulting docs of module
m
:Bug description
As you can see above, the
cfg(feature = "foo")
is mostly ignored on thepub use
items. Only external items withinline
take that attribute into account.Expected behavior
I would probably expect that the rendered
cfg
label on a re-export only depends oncfg(doc(…))
attributes on thepub use
itself. For ano_inline
item, this would mean that the label in the “Re-exports” list might differ from the label you see on the item itself once you click on it; maybe we want a more clear way to distinguish thecfg
of thepub use
from thecfg
of the used item.@rustbot label A-rustdoc-ui, F-doc_cfg, requires-nightly
The text was updated successfully, but these errors were encountered: