Fix FP in ZERO_PREFIXED_LITERAL and 0b/Oo

This commit is contained in:
mcarton 2016-08-28 17:59:01 +02:00
parent d8a50f5da4
commit e922fa80ce
No known key found for this signature in database
GPG Key ID: 5E427C794CBA45E8
3 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.
## 0.0.87 — ??
* Fix FP in [`zero_prefixed_literal`] and `0b`/`Oo`
## 0.0.86 — 2016-08-28
* Rustup to *rustc 1.13.0-nightly (a23064af5 2016-08-27)*
* New lints: [`missing_docs_in_private_items`], [`zero_prefixed_literal`]

View File

@ -287,6 +287,8 @@ impl EarlyLintPass for MiscEarly {
span_lint(cx, MIXED_CASE_HEX_LITERALS, lit.span,
"inconsistent casing in hexadecimal literal");
}
} else if src.starts_with("0b") || src.starts_with("0o") {
/* nothing to do */
} else if value != 0 && src.starts_with('0') {
span_lint_and_then(cx,
ZERO_PREFIXED_LITERAL,

View File

@ -32,4 +32,7 @@ fn main() {
//~|SUGGESTION = 123;
//~|HELP use `0o`
//~|SUGGESTION = 0o123;
let ok11 = 0o123;
let ok12 = 0b101010;
}