Skip to content

Commit 9c6dd14

Browse files
Fix dogfood
1 parent 3f1668f commit 9c6dd14

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clippy_lints/src/implicit_saturating_sub.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use clippy_config::Conf;
33
use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then};
44
use clippy_utils::source::snippet_opt;
55
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,
77
};
88
use rustc_ast::ast::LitKind;
99
use rustc_data_structures::packed::Pu128;
@@ -116,6 +116,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub {
116116
extract_msrv_attr!(LateContext);
117117
}
118118

119+
#[allow(clippy::too_many_arguments)]
119120
fn check_manual_check<'tcx>(
120121
cx: &LateContext<'tcx>,
121122
expr: &Expr<'tcx>,
@@ -154,6 +155,7 @@ fn check_manual_check<'tcx>(
154155
}
155156
}
156157

158+
#[allow(clippy::too_many_arguments)]
157159
fn check_gt(
158160
cx: &LateContext<'_>,
159161
condition_span: Span,
@@ -194,6 +196,7 @@ impl Var {
194196
}
195197
}
196198

199+
#[allow(clippy::too_many_arguments)]
197200
fn check_subtraction(
198201
cx: &LateContext<'_>,
199202
condition_span: Span,
@@ -237,7 +240,7 @@ fn check_subtraction(
237240
// if `snippet_opt` fails, it won't try the next conditions.
238241
if let Some(big_var_snippet) = snippet_opt(cx, big_var.span)
239242
&& 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))
241244
{
242245
span_lint_and_sugg(
243246
cx,

0 commit comments

Comments
 (0)