@@ -37,7 +37,7 @@ struct OperandInfo {
37
37
is_integral : bool ,
38
38
}
39
39
40
- fn analyze_operand ( operand : & Expr , cx : & LateContext < ' _ , ' _ > , expr : & Expr ) -> Option < OperandInfo > {
40
+ fn analyze_operand ( operand : & Expr < ' _ > , cx : & LateContext < ' _ , ' _ > , expr : & Expr < ' _ > ) -> Option < OperandInfo > {
41
41
match constant ( cx, cx. tables , operand) {
42
42
Some ( ( Constant :: Int ( v) , _) ) => match cx. tables . expr_ty ( expr) . kind {
43
43
ty:: Int ( ity) => {
@@ -82,7 +82,7 @@ fn might_have_negative_value(t: &ty::TyS<'_>) -> bool {
82
82
83
83
fn check_const_operands < ' a , ' tcx > (
84
84
cx : & LateContext < ' a , ' tcx > ,
85
- expr : & ' tcx Expr ,
85
+ expr : & ' tcx Expr < ' _ > ,
86
86
lhs_operand : & OperandInfo ,
87
87
rhs_operand : & OperandInfo ,
88
88
) {
@@ -106,7 +106,7 @@ fn check_const_operands<'a, 'tcx>(
106
106
}
107
107
}
108
108
109
- fn check_non_const_operands < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , expr : & ' tcx Expr , operand : & Expr ) {
109
+ fn check_non_const_operands < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , expr : & ' tcx Expr < ' _ > , operand : & Expr < ' _ > ) {
110
110
let operand_type = cx. tables . expr_ty ( operand) ;
111
111
if might_have_negative_value ( operand_type) {
112
112
span_lint_and_then (
@@ -125,7 +125,7 @@ fn check_non_const_operands<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Ex
125
125
}
126
126
127
127
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for ModuloArithmetic {
128
- fn check_expr ( & mut self , cx : & LateContext < ' a , ' tcx > , expr : & ' tcx Expr ) {
128
+ fn check_expr ( & mut self , cx : & LateContext < ' a , ' tcx > , expr : & ' tcx Expr < ' _ > ) {
129
129
match & expr. kind {
130
130
ExprKind :: Binary ( op, lhs, rhs) | ExprKind :: AssignOp ( op, lhs, rhs) => {
131
131
if let BinOpKind :: Rem = op. node {
0 commit comments