Skip to content

Valid underscores in hex/octal/binary literal docs#84017

Merged
bors merged 1 commit intorust-lang:masterfrom
syvb:int-literal-underscores
May 4, 2021
Merged

Valid underscores in hex/octal/binary literal docs#84017
bors merged 1 commit intorust-lang:masterfrom
syvb:int-literal-underscores

Conversation

@syvb
Copy link
Copy Markdown
Contributor

@syvb syvb commented Apr 8, 2021

Currently hex/octal/binary literals with computed values are displayed like 0_xff_fff_fffu32, which is invalid since underscores can't be in the middle of integer prefixes. This properly formats prefixed integers.

This causes std::u32::MAX to be displayed as

pub const MAX: u32 = u32::MAX; // 0_xff_fff_fffu32

This PR changes it to be displayed as:

pub const MAX: u32 = u32::MAX; // 0xffff_ffffu32

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants