rust-lang/rust-clippy
View on GitHubRewrite `arithmetic_side_effects` to not use matching on string representation of types
Open
#16,359 opened on Jan 8, 2026
C-enhancementgood first issue
Repository metrics
- Stars
- (10,406 stars)
- PR merge metrics
- (Avg merge 18d 15h) (115 merged PRs in 30d)
Description
Description
arithmetic_side_effects uses the string representation of types to compare them. This will miss aliases (including core/alloc → std), takes longer to compare, etc.
It should use a method similar to what is done in the disallowed_types lint, where maps of DefId or PrimTy are built at lint initialization time and then used throughout the tree walk. Some type lookup code could probably even be shared (including the part where unloaded crates don't cause errors).
Version
Additional Labels
No response