Skip to content

Implement missing members suggestion shadows type parameters #6870

@zeramorphic

Description

@zeramorphic

In the following minimal example in latest nightly (using a struct<T> DiagnosticResult { ... }), the "implement missing members" intention shadows the type parameter T.
image
image
This creates rather confusing error messages if you didn't actually read the code that it inserted!
image
The two type parameters T and T are different, but I imagine that in a more complex scenario than this, it could hide the source of bugs. I think rust-analyzer should probably output code similar to
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsS-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