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

zero_prefixed_literal regression #5187

Closed
crumblingstatue opened this issue Feb 17, 2020 · 1 comment
Closed

zero_prefixed_literal regression #5187

crumblingstatue opened this issue Feb 17, 2020 · 1 comment

Comments

@crumblingstatue
Copy link

fn main() {
    let ascii_cr = 0xD;
}
warning: this is a decimal constant
 --> src/main.rs:2:20
  |
2 |     let ascii_cr = 0xD;
  |                    ^^^
  |
  = note: `#[warn(clippy::zero_prefixed_literal)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
  |
2 |     let ascii_cr = xD;
  |                    ^^
help: if you mean to use an octal constant, use `0o`
  |
2 |     let ascii_cr = 0oxD;
  |                    ^^^^

This didn't use to trigger.
The intention may be to suggest 0x0D?

ver: clippy 0.0.212 (07f1736 2020-02-11)

@crumblingstatue
Copy link
Author

Never mind, duplicate of #5169 , I don't know why my initial search didn't find it.

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

1 participant