@@ -3,7 +3,7 @@ use clippy_config::Conf;
3
3
use clippy_utils:: diagnostics:: { span_lint_and_sugg, span_lint_and_then} ;
4
4
use clippy_utils:: source:: snippet_opt;
5
5
use clippy_utils:: {
6
- higher, in_constant , is_integer_literal, path_to_local, peel_blocks, peel_blocks_with_stmt, SpanlessEq ,
6
+ higher, is_in_const_context , is_integer_literal, path_to_local, peel_blocks, peel_blocks_with_stmt, SpanlessEq ,
7
7
} ;
8
8
use rustc_ast:: ast:: LitKind ;
9
9
use rustc_data_structures:: packed:: Pu128 ;
@@ -116,6 +116,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub {
116
116
extract_msrv_attr ! ( LateContext ) ;
117
117
}
118
118
119
+ #[ allow( clippy:: too_many_arguments) ]
119
120
fn check_manual_check < ' tcx > (
120
121
cx : & LateContext < ' tcx > ,
121
122
expr : & Expr < ' tcx > ,
@@ -154,6 +155,7 @@ fn check_manual_check<'tcx>(
154
155
}
155
156
}
156
157
158
+ #[ allow( clippy:: too_many_arguments) ]
157
159
fn check_gt (
158
160
cx : & LateContext < ' _ > ,
159
161
condition_span : Span ,
@@ -194,6 +196,7 @@ impl Var {
194
196
}
195
197
}
196
198
199
+ #[ allow( clippy:: too_many_arguments) ]
197
200
fn check_subtraction (
198
201
cx : & LateContext < ' _ > ,
199
202
condition_span : Span ,
@@ -237,7 +240,7 @@ fn check_subtraction(
237
240
// if `snippet_opt` fails, it won't try the next conditions.
238
241
if let Some ( big_var_snippet) = snippet_opt ( cx, big_var. span )
239
242
&& let Some ( little_var_snippet) = snippet_opt ( cx, little_var. span )
240
- && ( !in_constant ( cx, if_block . hir_id ) || msrv. meets ( msrvs:: SATURATING_SUB_CONST ) )
243
+ && ( !is_in_const_context ( cx) || msrv. meets ( msrvs:: SATURATING_SUB_CONST ) )
241
244
{
242
245
span_lint_and_sugg (
243
246
cx,
0 commit comments