Skip to content

Implement default members implements PartialEq::ne incorrectly #12779

Closed
@awused

Description

@awused

rust-analyzer version: rust-analyzer 0.0.0 (5342f47 2022-07-09)

rustc version: rustc 1.62.0 (a8314ef7d 2022-06-27)

relevant settings: Neovim with coc-rust-analyzer

I tried implement default members on some code by mistake, but got surprising results. Reproduction:

struct SomeStruct {
    data: Arc<Vec<u8>>,
    field: (u32, u32),
}

impl PartialEq for SomeStruct {
}

It will generate this ne method:

impl PartialEq for SomeStruct {
    fn ne(&self, other: &Self) -> bool {
        self.data == other.data && self.field == other.field
    }
}

The implement missing members works as expected for eq

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsC-bugCategory: bugS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions