Skip to content

rustdoc generates ugly output for constants and statics #19046

Closed
@ghost

Description

Here's what I think is wrong:

  1. The keywords pub, and const appear next to the name of the constant, when clearly they are redundant.
  2. Accessing the constants page through search brings the user to an empty page.
  3. The value assigned to the constant appears along side its name.
    When reading the documentation of constants, the most important information is the name of the constant and its description. Having the declaration appear inline makes scanning for the name of harder.

Better output would replace the declaration with the name of the constant followed by its type.
Also it would move the declaration of the constant to the empty page mentioned in point 2 and have the identifier of the constant link to this page.

All these points are relevant for statics as well.

Example of ugly output:
rustdoc-constants-ugly

This page should show the definition and a description of the constant:
rustdoc-constans-empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-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