Skip to content

rustdoc should be able to build documentation from compiled crates #2206

Open
@brson

Description

@brson

rustdocs are built from attributes which are (should be) stored in the crate metadata. rustdoc should be able to construct the crate documentation from the crate metadata with nearly the same fidelity as from the original source.

Update(2024, fmease): In today's terms, this essentially asks for the option1 to build docs based on rustc_middle::ty instead of the HIR in the all cases, not just for inlined cross-crate re-exports and synthetic impls.

Footnotes

  1. Some t-rustdoc members (incl. myself, @fmease) are even inclined to drop "HIR cleaning" entirely once the important A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate issues have been addressed (which is non-trivial I have to add). In the long term, that move would greatly improve the correctness of rustdoc and make it easier to develop certain features. Namely anything that depends on more complex "type-based reasoning" (for which rustc_middle::ty is a lot better suited compared to the HIR).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-metadataArea: Crate metadataC-enhancementCategory: An issue proposing an enhancement or a PR with one.P-lowLow priorityT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions