Skip to content

deprecate (and possibly destabilize) Eq::assert_receiver_is_total_eq #704

@cyrgani

Description

@cyrgani

The Eq::assert_receiver_is_total_eq method is purely meant as an implementation detail by #[derive(Eq)] to add checks that all fields of the type the derive is applied to also implement Eq.
The method is already #[doc(hidden)] and has a comment saying // This should never be implemented by hand..
Unfortunately, it has been stable since 1.0 and there are some cases on GitHub (https://github.com/search?q=assert_receiver_is_total_eq&type=code) where people have implemented this method manually, sometimes even with actual code in the method body.
To prevent further confusion from this, I propose deprecating the method and perhaps destabilizing it in the future, if the breakage is low enough.
(It should also be possible to move the compiler-generated checks in assert_receiver_is_total_eq into a const _: () = { ... }, removing any need for this method entirely.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions