rust-lang / rust-lang/rust

rustdoc converts byte literal discriminants into decimal numbers

Open
#128,347 1 comment 2 reactions 1 assignee View on GitHub

@lolbinarycat is already working on this.

Since Oct 20, 2024.

A-rustdoc-ui C-bug T-rustdoc T-rustdoc-frontend
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.