-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
new lint: init-numbered-fields
#8170
Conversation
9940d5f
to
d6656c3
Compare
🎉 Will this be suppressed in macros by default? I think that macros might be a legitimate use of numbered fields to let them treat tuples like other structs. |
Good point, I've added a macro check. |
d6656c3
to
91ec91b
Compare
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.
TIL that you can construct tuples like structs ^^. The implementation looks good to me, it would be good if you could add one more test to see if the suggestion is correct for out of order fields 🙃. Then it's ready to be merged 👍
Do we maybe want to change the lint name to something more precise? When I first read it, I thought this would be linting struct definitions like |
91ec91b
to
ee59ce5
Compare
Numbers are not valid field names in struct definitions, so I don't think we need to explicitly rule out that case. And I'd like to keep it short. If we were to be exact, it would need to be called |
If we want to keep it short then I have one more suggestion what about |
ee59ce5
to
3ebd2bc
Compare
Ok, renamed. I kept the test's name though. Is that OK with you? |
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.
Ok, renamed. I kept the test's name though. Is that OK with you?
Sure, thank you for renaming the lint, I like this name more!
And thank you for the lint implementation! 👍 @bors r+ |
📌 Commit 3ebd2bc has been approved by |
new lint: `init-numbered-fields` This fixes #7985. r? `@xFrednet` --- changelog: new lint: [`init_numbered_fields`]
💥 Test timed out |
@bors retry |
new lint: `init-numbered-fields` This fixes #7985. r? `@xFrednet` --- changelog: new lint: [`init_numbered_fields`]
💥 Test timed out |
That is weird. I didn't have any problems when running the tests locally. |
Bors is acting up a bit today, the last PR merged in rust-lang/rust was also yesterday. I'm guessing we can try another retry @bors retry |
new lint: `init-numbered-fields` This fixes #7985. r? `@xFrednet` --- changelog: new lint: [`init_numbered_fields`]
💔 Test failed - checks-action_remark_test |
@bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This fixes #7985.
r? @xFrednet
changelog: new lint: [
init_numbered_fields
]