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

Format long numeric literals #3594

Closed
tesuji opened this issue May 30, 2019 · 5 comments
Closed

Format long numeric literals #3594

tesuji opened this issue May 30, 2019 · 5 comments

Comments

@tesuji
Copy link
Contributor

tesuji commented May 30, 2019

I got this warning from clippy:

warning: long literal lacking separators
  --> src/elf/gnu_hash.rs:38:43
   |
38 |         assert_eq!(hash("flapenguin.me"), 0x8ae9f18e);
   |                                           ^^^^^^^^^^ help: consider: `0x8ae9_f18e`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal

It would be better if rustfmt can handle it automatically.

@sinkuu
Copy link
Contributor

sinkuu commented May 30, 2019

unreadable_literal emits a machine-applicable suggestion, which would (hopefully) become auto-fixable by cargo fix with clippy integration in the future.

@scampi
Copy link
Contributor

scampi commented May 30, 2019

The rustfmt tool is not made for fixing such things

@scampi scampi closed this as completed May 30, 2019
@tesuji
Copy link
Contributor Author

tesuji commented May 31, 2019

What I mean is not fixing those clippy lints. But rustfmt could format those long
numeric literals while running?

@scampi
Copy link
Contributor

scampi commented May 31, 2019

@lzutao Given the assert expression in the description, what would you expect the formatting to be ?

@calebcartwright
Copy link
Member

This is something rustfix is great for, but is not something that fits in rustfmt's purview and thus is not something we'll implement

@calebcartwright calebcartwright closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants