-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest setting associated type when type argument is given instead #48288
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
When finding too many type arguments and too few associated types, suggest using associated types in the appropriate place instead.
d957f49
to
d25c8d5
Compare
WIP: it would be ideal to present only one error instead of two, specially in the case of only one associated type missing and one unnecessary type argument being present. |
Ping from triage, @estebank! Any progress on this to report? |
I will be picking this up during the weekend. I am unhappy with the current output as it doesn't take associated items into account when creating the diagnostic, so there are cases where the extra help is wrong. I haven't "fixed" the tests that are broken to avoid this getting merged by accident. |
Ping from triage @estebank! Have you worked on this recently? |
I've been kind of busy. I'll get back to it soon, but if you wish to close to keep the backlog clean, go ahead. |
Suggest correct syntax when writing type arg instead of assoc type - When confusing an associated type with a type argument, suggest the appropriate syntax. Given `Iterator<isize>`, suggest `Iterator<Item = isize>`. - When encountering multiple missing associated types, emit only one diagnostic. - Point at associated type def span for context. - Point at each extra type argument. Follow up to #48288, fix #20977.
When finding too many type arguments and too few associated types,
suggest using associated types in the appropriate place instead.
Fix #20977.