fix typo in numeric_arithmetic logic (#13820)

Looks like typo for me.

Looking at blame
b76b0aeb63 (diff-ac15e787d7d276b24f251f4f5bdedf1e6ac81aa1e2ea0db27219e9a7fa8b0b30L66)
the same typo was before.

Is logic here actually correct? Tests passed locally, but i expected
some changes.

changelog: none
This commit is contained in:
Timo 2024-12-15 20:50:02 +00:00 committed by GitHub
commit 60dbda209e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,8 +43,8 @@ impl Context {
_ => (),
}
let (_, r_ty) = (cx.typeck_results().expr_ty(l), cx.typeck_results().expr_ty(r));
if r_ty.peel_refs().is_floating_point() && r_ty.peel_refs().is_floating_point() {
let (l_ty, r_ty) = (cx.typeck_results().expr_ty(l), cx.typeck_results().expr_ty(r));
if l_ty.peel_refs().is_floating_point() && r_ty.peel_refs().is_floating_point() {
span_lint(cx, FLOAT_ARITHMETIC, expr.span, "floating-point arithmetic detected");
self.expr_id = Some(expr.hir_id);
}