@@ -9,7 +9,7 @@ use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
99use rustc:: session:: Session ;
1010use rustc:: { declare_lint_pass, declare_tool_lint} ;
1111use rustc_data_structures:: fx:: FxHashMap ;
12- use syntax:: ast:: { Attribute , LitKind } ;
12+ use syntax:: ast:: { Attribute , LitFloatType , LitKind } ;
1313
1414declare_clippy_lint ! {
1515 /// **What it does:** Generates clippy code that detects the offending pattern
@@ -288,10 +288,14 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
288288 LitKind :: Byte ( b) => println ! ( " if let LitKind::Byte({}) = {}.node;" , b, lit_pat) ,
289289 // FIXME: also check int type
290290 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+ ) ,
295299 LitKind :: ByteStr ( ref vec) => {
296300 let vec_pat = self . next ( "vec" ) ;
297301 println ! ( " if let LitKind::ByteStr(ref {}) = {}.node;" , vec_pat, lit_pat) ;
0 commit comments