-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 tuple struct syntax #61782
suggest tuple struct syntax #61782
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
LGTM. |
IMHO providing the constructor signature would be a better hint. Since only type and order matter for "tuple" syntax. |
5bd3ad1
to
47fc513
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
736b29c
to
7fc97c2
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7fc97c2
to
f7ecf1c
Compare
This comment has been minimized.
This comment has been minimized.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we would try to use a structured suggestion that gives out the correct code (which is why @petrochenkov was asking for my input), but I think this is a good first pass at a solution which can be improved upon down the line.
Left some nitpicks inline that shouldn't be too hard to address.
In order to do so you would need to modify this code to not emit one error per field, but rather per invocation, and only once you figure out you have the correct amount of fields (and the correct types for them!) you can emit one error with the structured suggestion. I don't want perfect be enemy of the good enough that will make things materially better :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R=me once the nitpicks have been addressed.
@bors r=estebank |
@Electron-libre: 🔑 Insufficient privileges: Not in reviewers |
@bors r+ rollup |
📌 Commit b72b1ac has been approved by |
…_syntax, r=estebank suggest tuple struct syntax refs rust-lang#57242
refs #57242