1 use clippy_utils::diagnostics::span_lint_and_help;
3 use rustc_lint::LateContext;
5 use super::INTEGER_DIVISION;
7 pub(crate) fn check<'tcx>(
8 cx: &LateContext<'tcx>,
9 expr: &'tcx hir::Expr<'_>,
11 left: &'tcx hir::Expr<'_>,
12 right: &'tcx hir::Expr<'_>,
14 if op == hir::BinOpKind::Div
15 && cx.typeck_results().expr_ty(left).is_integral()
16 && cx.typeck_results().expr_ty(right).is_integral()
24 "division of integers may cause loss of precision. consider using floats",