Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Lower/UpperExp formatting for integers and precision zero #89502

Merged
merged 2 commits into from
Oct 6, 2021

Conversation

FabianWolff
Copy link
Contributor

Fixes the integer part of #89493 (I daren't touch the floating-point formatting code). The issue is that the "subtracted" precision essentially behaves like extra trailing zeros, but this is not currently reflected in the code properly.

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 3, 2021
@joshtriplett
Copy link
Member

joshtriplett commented Oct 4, 2021

While this fixes the trailing ., I'm not sure if this is the intended rounding. It's inconsistent with floating-point values, which (I believe) default to "round to nearest even".

In the interests of getting this bugfix in without depending on the rounding mode, I'd propose that we change the test to a value that'll round the same whether integer or float.

@joshtriplett
Copy link
Member

joshtriplett commented Oct 4, 2021

r=me with the test changed.

EDIT: I'm going to try GitHub's "commit suggestion" feature, to avoid an additional delay on this bugfix.

@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 4, 2021

📌 Commit 199b33f has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 4, 2021
Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 5, 2021
…lett

Fix Lower/UpperExp formatting for integers and precision zero

Fixes the integer part of rust-lang#89493 (I daren't touch the floating-point formatting code). The issue is that the "subtracted" precision essentially behaves like extra trailing zeros, but this is not currently reflected in the code properly.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2021
…arth

Rollup of 10 pull requests

Successful merges:

 - rust-lang#88706 (Normalize associated type projections when checking return type of main)
 - rust-lang#88828 (Use `libc::sigaction()` instead of `sys::signal()` to prevent a deadlock)
 - rust-lang#88871 (Fix suggestion for nested struct patterns)
 - rust-lang#89317 (Move generic error message to separate branches)
 - rust-lang#89351 (for signed wrapping remainder, do not compare lhs with MIN)
 - rust-lang#89442 (Add check for duplicated doc aliases)
 - rust-lang#89502 (Fix Lower/UpperExp formatting for integers and precision zero)
 - rust-lang#89523 (Make `proc_macro_derive_resolution_fallback` a future-breakage lint)
 - rust-lang#89532 (Document behavior of  `MaybeLiveLocals` regarding enums and field-senstivity)
 - rust-lang#89546 (Make an initial guess for metadata size to reduce buffer resizes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4e8c853 into rust-lang:master Oct 6, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants