WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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