Skip to content

rustdoc converts byte literal discriminants into decimal numbers #128347

Open
@clarfonthey

Description

@clarfonthey

For some code that generates my command prompt, I use a single ASCII character for the discriminant of an enum:

pub enum Permissions {
    Guest = b'%',
    User = b'$',
    System = b'@',
    Absolute = b'#',
}

However, rustdoc displays this as:

pub enum Permissions {
    Guest = 37,
    User = 36,
    System = 64,
    Absolute = 35,
}

Personally, I think that rustdoc should try to display the literal as it was originally written, rather than converting it to a plain integer.

Meta

rustdoc --version --verbose:

rustdoc 1.81.0-nightly (9057c3ffe 2024-07-19)
binary: rustdoc
commit-hash: 9057c3ffec44926d5e149dc13ff3ce1613b69cce
commit-date: 2024-07-19
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7

Metadata

Metadata

Assignees

Labels

A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions