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

New false positive in zero_prefixed_literal #5169

Closed
dtolnay opened this issue Feb 13, 2020 · 0 comments · Fixed by #5170
Closed

New false positive in zero_prefixed_literal #5169

dtolnay opened this issue Feb 13, 2020 · 0 comments · Fixed by #5170
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@dtolnay
Copy link
Member

dtolnay commented Feb 13, 2020

fn main() {
    let _ = 0xF;
}
warning: this is a decimal constant
 --> src/main.rs:2:13
  |
2 |     let _ = 0xF;
  |             ^^^
  |
  = 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 _ = xF;
  |             ^^
help: if you mean to use an octal constant, use `0o`
  |
2 |     let _ = 0oxF;
  |             ^^^^

Neither of Clippy's two suggestions of xF and 0oxF are compilable.

Mentioning @JohnTitor @flip1995 because I believe this is a regression introduced in #5129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants