rust-analyzer
rust-analyzer copied to clipboard
Implement missing members suggestion shadows type parameters
In the following minimal example in latest nightly (using a struct<T> DiagnosticResult { ... }), the "implement missing members" intention shadows the type parameter T.
This creates rather confusing error messages if you didn't actually read the code that it inserted!
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

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