diff options
| author | Timo <30553356+y21@users.noreply.github.com> | 2024-12-15 20:50:02 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-15 20:50:02 +0000 |
| commit | 60dbda209e9f3bf416f1dc4cd99d0d866f94b309 (patch) | |
| tree | e8ea0695774c7a26e76061d0706a117c1ad4f8c9 /clippy_lints/src | |
| parent | b8e569e9c006100be58155d037735561fe600faf (diff) | |
| parent | db35e308c2b92ed13369ea53ad54625abcf4422c (diff) | |
| download | rust-60dbda209e9f3bf416f1dc4cd99d0d866f94b309.tar.gz rust-60dbda209e9f3bf416f1dc4cd99d0d866f94b309.zip | |
fix typo in `numeric_arithmetic` logic (#13820)
Looks like typo for me. Looking at blame https://github.com/rust-lang/rust-clippy/commit/b76b0aeb63948fecca6d6f603f47c6648059048a#diff-ac15e787d7d276b24f251f4f5bdedf1e6ac81aa1e2ea0db27219e9a7fa8b0b30L66 the same typo was before. Is logic here actually correct? Tests passed locally, but i expected some changes. changelog: none
Diffstat (limited to 'clippy_lints/src')
| -rw-r--r-- | clippy_lints/src/operators/numeric_arithmetic.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/operators/numeric_arithmetic.rs b/clippy_lints/src/operators/numeric_arithmetic.rs index d369978b8be..2083f2bf628 100644 --- a/clippy_lints/src/operators/numeric_arithmetic.rs +++ b/clippy_lints/src/operators/numeric_arithmetic.rs @@ -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); } |
