about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/excessive_precision.rs6
-rw-r--r--rustc_tools_util/src/lib.rs3
-rw-r--r--tests/ui/excessive_precision.rs3
3 files changed, 7 insertions, 5 deletions
diff --git a/clippy_lints/src/excessive_precision.rs b/clippy_lints/src/excessive_precision.rs
index 6df88cdc6c3..0ae228d1dea 100644
--- a/clippy_lints/src/excessive_precision.rs
+++ b/clippy_lints/src/excessive_precision.rs
@@ -98,8 +98,9 @@ impl ExcessivePrecision {
     }
 }
 
-/// Should we exclude the float because it has a .0 suffix
+/// Should we exclude the float because it has a `.0` or `.` suffix
 /// Ex 1_000_000_000.0
+/// Ex 1_000_000_000.
 fn dot_zero_exclusion(s: &str) -> bool {
     if let Some(after_dec) = s.split('.').nth(1) {
         let mut decpart = after_dec
@@ -108,7 +109,8 @@ fn dot_zero_exclusion(s: &str) -> bool {
 
         match decpart.next() {
             Some('0') => decpart.count() == 0,
-            _ => false,
+            Some(_) => false,
+            None => true,
         }
     } else {
         false
diff --git a/rustc_tools_util/src/lib.rs b/rustc_tools_util/src/lib.rs
index bbe86be3c7c..09d80072d66 100644
--- a/rustc_tools_util/src/lib.rs
+++ b/rustc_tools_util/src/lib.rs
@@ -1,6 +1,3 @@
-#![feature(test)]
-#![feature(tool_lints)]
-
 use std::env;
 
 #[macro_export]
diff --git a/tests/ui/excessive_precision.rs b/tests/ui/excessive_precision.rs
index b44364d6beb..1b3412166d4 100644
--- a/tests/ui/excessive_precision.rs
+++ b/tests/ui/excessive_precision.rs
@@ -54,4 +54,7 @@ fn main() {
 
     let good_bige32: f32 = 1E-10;
     let bad_bige32: f32 = 1.123_456_788_888E-10;
+
+    // Inferred type
+    let good_inferred: f32 = 1f32 * 1_000_000_000.;
 }