rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Implement missing members suggestion shadows type parameters

Open zeramorphic opened this issue 5 years ago • 1 comments

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

zeramorphic avatar Dec 14 '20 10:12 zeramorphic

Yes, we did not check for possible duplicate names, but this will be fixed in https://github.com/rust-lang/rust-analyzer/pull/21118.

Natural-selection1 avatar Nov 24 '25 14:11 Natural-selection1