Skip to content

Rewrite arithmetic_side_effects to not use matching on string representation of types #16359

@samueltardieu

Description

@samueltardieu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions