Skip to content

"Implement missing members" doesn't handle default generic type parameters #3877

@Vlad-Shcherbina

Description

@Vlad-Shcherbina

To reproduce, invoke "Implement missing members" assist on the following program:

struct S;
impl PartialEq for S {}

Actual result:

impl PartialEq for S {
    fn eq(&self, other: &Rhs) -> std::primitive::bool { unimplemented!() }
}

This does not compile: "cannot find type `Rhs` in this scope".

Expected result:

impl PartialEq for S {
    fn eq(&self, other: &Self) -> std::primitive::bool { unimplemented!() }
}

Because PartialEq<Rhs=Self>.


rust-analyzer version: 2020-04-06 (c859a64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-has-instructionsIssue has some instructions and pointers to code to get startedE-unknownIt's unclear if the issue is E-hard or E-easy without digging in

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions