@@ -5,7 +5,7 @@ use rustc_abi::{BackendRepr, ExternAbi, TagEncoding, VariantIdx, Variants, Wrapp
55use rustc_data_structures:: fx:: FxHashSet ;
66use rustc_errors:: DiagMessage ;
77use rustc_hir:: intravisit:: VisitorExt ;
8- use rustc_hir:: { AmbigArg , Expr , ExprKind , LangItem } ;
8+ use rustc_hir:: { AmbigArg , Expr , ExprKind , HirId , LangItem } ;
99use rustc_middle:: bug;
1010use rustc_middle:: ty:: layout:: { LayoutOf , SizeSkeleton } ;
1111use rustc_middle:: ty:: {
@@ -536,6 +536,16 @@ fn lint_fn_pointer<'tcx>(
536536}
537537
538538impl < ' tcx > LateLintPass < ' tcx > for TypeLimits {
539+ fn check_lit (
540+ & mut self ,
541+ cx : & LateContext < ' tcx > ,
542+ hir_id : HirId ,
543+ lit : & ' tcx hir:: Lit ,
544+ negated : bool ,
545+ ) {
546+ lint_literal ( cx, self , hir_id, lit. span , lit, negated)
547+ }
548+
539549 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , e : & ' tcx hir:: Expr < ' tcx > ) {
540550 match e. kind {
541551 hir:: ExprKind :: Unary ( hir:: UnOp :: Neg , expr) => {
@@ -557,7 +567,6 @@ impl<'tcx> LateLintPass<'tcx> for TypeLimits {
557567 }
558568 }
559569 }
560- hir:: ExprKind :: Lit ( lit) => lint_literal ( cx, self , e. hir_id , e. span , lit) ,
561570 hir:: ExprKind :: Call ( path, [ l, r] )
562571 if let ExprKind :: Path ( ref qpath) = path. kind
563572 && let Some ( def_id) = cx. qpath_res ( qpath, path. hir_id ) . opt_def_id ( )
0 commit comments