INTERNAL_EQ_TRAIT_METHOD_IMPLS in rustc_lint::builtin - Rust
Description: The `internal_eq_trait_method_impls` lint detects manual implementations of `Eq::assert_receiver_is_total_eq`.

Skip to main content

## INTERNAL_EQ_TRAIT_METHOD_IMPLS

# Static INTERNAL_EQ_TRAIT_METHOD_IMPLS

Source

    pub static INTERNAL_EQ_TRAIT_METHOD_IMPLS: &Lint

Expand description

The `internal_eq_trait_method_impls` lint detects manual implementations of `Eq::assert_receiver_is_total_eq`.

#### §Example

    #[derive(PartialEq)]
    pub struct Foo;

    impl Eq for Foo {
        fn assert_receiver_is_total_eq(&self) {}
    }

{{produces}}

#### §Explanation

This method existed so that `#[derive(Eq)]` could check that all fields of a type implement `Eq`. Other users were never supposed to implement it and it was hidden from documentation.

Unfortunately, it was not explicitly marked as unstable and some people have now mistakenly assumed they had to implement this method.

As the method is never called by the standard library, you can safely remove any implementations of the method and just write `impl Eq for Foo {}`.

This is a [future-incompatible] lint to transition this to a hard error in the future. See issue #152336 for more details.