rust-lang/rust-clippy

Rewrite `arithmetic_side_effects` to not use matching on string representation of types

Ouverte

#16 359 ouverte le 8 janv. 2026

 (1 commentaire) (1 réaction) (1 personne assignée)Rust (1 391 forks)batch import
C-enhancementgood first issue

Métriques du dépôt

Stars
 (10 406 étoiles)
Métriques de merge PR
 (Merge moyen 19j 22h) (113 PRs mergées en 30 j)

Description

Description

arithmetic_side_effects uses the string representation of types to compare them. This will miss aliases (including core/allocstd), 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

Guide contributeur