@@ -5,7 +5,7 @@ use rustc_abi::{BackendRepr, ExternAbi, TagEncoding, VariantIdx, Variants, Wrapp
5
5
use rustc_data_structures:: fx:: FxHashSet ;
6
6
use rustc_errors:: DiagMessage ;
7
7
use rustc_hir:: intravisit:: VisitorExt ;
8
- use rustc_hir:: { AmbigArg , Expr , ExprKind , LangItem } ;
8
+ use rustc_hir:: { AmbigArg , Expr , ExprKind , HirId , LangItem } ;
9
9
use rustc_middle:: bug;
10
10
use rustc_middle:: ty:: layout:: { LayoutOf , SizeSkeleton } ;
11
11
use rustc_middle:: ty:: {
@@ -536,6 +536,16 @@ fn lint_fn_pointer<'tcx>(
536
536
}
537
537
538
538
impl < ' 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
+
539
549
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , e : & ' tcx hir:: Expr < ' tcx > ) {
540
550
match e. kind {
541
551
hir:: ExprKind :: Unary ( hir:: UnOp :: Neg , expr) => {
@@ -557,7 +567,6 @@ impl<'tcx> LateLintPass<'tcx> for TypeLimits {
557
567
}
558
568
}
559
569
}
560
- hir:: ExprKind :: Lit ( lit) => lint_literal ( cx, self , e. hir_id , e. span , lit) ,
561
570
hir:: ExprKind :: Call ( path, [ l, r] )
562
571
if let ExprKind :: Path ( ref qpath) = path. kind
563
572
&& let Some ( def_id) = cx. qpath_res ( qpath, path. hir_id ) . opt_def_id ( )
0 commit comments