@@ -9,7 +9,7 @@ use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
9
9
use rustc:: session:: Session ;
10
10
use rustc:: { declare_lint_pass, declare_tool_lint} ;
11
11
use rustc_data_structures:: fx:: FxHashMap ;
12
- use syntax:: ast:: { Attribute , LitKind } ;
12
+ use syntax:: ast:: { Attribute , LitFloatType , LitKind } ;
13
13
14
14
declare_clippy_lint ! {
15
15
/// **What it does:** Generates clippy code that detects the offending pattern
@@ -288,10 +288,14 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
288
288
LitKind :: Byte ( b) => println ! ( " if let LitKind::Byte({}) = {}.node;" , b, lit_pat) ,
289
289
// FIXME: also check int type
290
290
LitKind :: Int ( i, _) => println ! ( " if let LitKind::Int({}, _) = {}.node;" , i, lit_pat) ,
291
- LitKind :: Float ( ..) => println ! ( " if let LitKind::Float(..) = {}.node;" , lit_pat) ,
292
- LitKind :: FloatUnsuffixed ( _) => {
293
- println ! ( " if let LitKind::FloatUnsuffixed(_) = {}.node;" , lit_pat)
294
- } ,
291
+ LitKind :: Float ( _, LitFloatType :: Suffixed ( _) ) => println ! (
292
+ " if let LitKind::Float(_, LitFloatType::Suffixed(_)) = {}.node;" ,
293
+ lit_pat
294
+ ) ,
295
+ LitKind :: Float ( _, LitFloatType :: Unsuffixed ) => println ! (
296
+ " if let LitKind::Float(_, LitFloatType::Unsuffixed) = {}.node;" ,
297
+ lit_pat
298
+ ) ,
295
299
LitKind :: ByteStr ( ref vec) => {
296
300
let vec_pat = self . next ( "vec" ) ;
297
301
println ! ( " if let LitKind::ByteStr(ref {}) = {}.node;" , vec_pat, lit_pat) ;
0 commit comments