-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Added new lint: reserve_after_initialization
#11373
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @blyxyas (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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.
Looks pretty good to me already for a first contribution 👀 but I have one question
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.
WOW, really cool for a first lint, just some minor nits, but very very good overall ❤️, I'm really impressed!
I added some tests and fixed everything you mentioned except for:
|
Btw I think you can mark things that are done as resolved, that might make it a little easier to read through and see what's left ^^ (saying this because my very first comment is taking up lots of space and that comment is not relevant anymore/already applied, I can't click "resolve" myself it looks like) |
I just noticed that actually testing with macros isn't really documented anywhere, so I'll do a tutorial here. In our test suite headers can be used with the "//@" syntax. E.g. "//@run-rustfix" as the first line is a header. So, after using The auxiliary proc macro We really should document this, #10597 |
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.
Just the last few tiny nits I could find ^^. After these it looks good to me 👍
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.
Just this mini-nit and it should be good to go! Really impressive for a first contribution ❤️
Edit: @y21 let me know if you also think this is ready, your reviews were very helpful!
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.
LGTM!
your reviews were very helpful!
Thanks :D Glad to be of help
@bors r=blyxyas,y21 |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Closes #11330.
A new lint that informs the user about a more concise way to create a vector with a known capacity.
Example:
Produces the following help:
And can be rewritten as:
changelog: new lint [
reserve_after_initialization
]