Skip to content

Lint on pointer comparisons for non-thin pointers. #117717

Closed
@scottmcm

Description

@scottmcm

Per the 2023-11-08 lang triage meeting, lang would like to see a lint like the one in the second bullet from #106447 (comment) :

Deprecate comparisons (Eq/Ord) on dyn trait pointers by adding a lint which encourages people to case the pointer to *mut u8 first. This makes the intent of such comparisons much clearer.

The lint should not warn on comparison of thin pointers.

When non-thin pointers are compared (whether with == or != or PartialEq methods directly), the lint should warn, suggesting that you do one of the following instead:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.E-help-wantedCall for participation: Help is requested to fix this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions