Skip to content

Commit e922fa8

Browse files
committed
Fix FP in ZERO_PREFIXED_LITERAL and 0b/Oo
1 parent d8a50f5 commit e922fa8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## 0.0.87 — ??
5+
* Fix FP in [`zero_prefixed_literal`] and `0b`/`Oo`
6+
47
## 0.0.86 — 2016-08-28
58
* Rustup to *rustc 1.13.0-nightly (a23064af5 2016-08-27)*
69
* New lints: [`missing_docs_in_private_items`], [`zero_prefixed_literal`]

clippy_lints/src/misc_early.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ impl EarlyLintPass for MiscEarly {
287287
span_lint(cx, MIXED_CASE_HEX_LITERALS, lit.span,
288288
"inconsistent casing in hexadecimal literal");
289289
}
290+
} else if src.starts_with("0b") || src.starts_with("0o") {
291+
/* nothing to do */
290292
} else if value != 0 && src.starts_with('0') {
291293
span_lint_and_then(cx,
292294
ZERO_PREFIXED_LITERAL,

tests/compile-fail/literals.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ fn main() {
3232
//~|SUGGESTION = 123;
3333
//~|HELP use `0o`
3434
//~|SUGGESTION = 0o123;
35+
36+
let ok11 = 0o123;
37+
let ok12 = 0b101010;
3538
}

0 commit comments

Comments
 (0)