Summary
This is a followup to #16490 which expanded this lint.
There are a number of inherent methods on integers that perform division which this lint should also catch. This is not an exhaustive list, but here are some that would be nice to catch:
Lint Name
integer_division_remainder_used
Reproducer
This is an example for div_ceil, but the problem persists for all of the above inherent methods:
#![warn(clippy::integer_division_remainder_used)]
pub fn div_ceil_by_three(x: u16) -> u16 {
x.div_ceil(3)
}
Version
rustc 1.98.0 (88d9e12ae 2026-08-18)
binary: rustc
commit-hash: 88d9e12ae178fab0fb5cc050a94da85685d449ea
commit-date: 2026-08-18
host: aarch64-apple-darwin
release: 1.98.0
LLVM version: 22.1.8
Summary
This is a followup to #16490 which expanded this lint.
There are a number of inherent methods on integers that perform division which this lint should also catch. This is not an exhaustive list, but here are some that would be nice to catch:
checked_divchecked_div_euclidchecked_div_exactchecked_remchecked_rem_eucliddiv_ceildiv_eucliddiv_exactoverflowing_divoverflowing_div_euclidoverflowing_removerflowing_rem_euclidrem_euclidstrict_divstrict_div_euclidsaturating_divstrict_remstrict_rem_euclidwrapping_divwrapping_div_euclidwrapping_remwrapping_rem_euclidLint Name
integer_division_remainder_used
Reproducer
This is an example for
div_ceil, but the problem persists for all of the above inherent methods:Version