-
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
Added lint str_to_string #6333
Added lint str_to_string #6333
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I have commented out some lines, you can check and let me know if i should remove those lines. Also running cargo dev update lints, adds store.register_removed to src/lib.rs for str_to_string and string_to_string. How can i fix this? |
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.
Only some NITs, thanks for working on this.
On a general note, do not hesitate to remove the lines instead of commenting them, I think it is more visual and easy to review removed lines 😄
Also, you can update ui/deprecated.rs
and ui/deprecated_old.rs
.
Also running cargo dev update lints, adds store.register_removed to src/lib.rs for str_to_string and string_to_string. How can i fix this?
That's weird, I'd say removing stuff from clippy_lints/src/lib.rs
would do the trick, but maybe there is some mechanism for removed lints I am not aware. If I found something I'll let you know.
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.
impl LGTM overall. Some code cleanup left to do.
Also running cargo dev update lints, adds store.register_removed to src/lib.rs for str_to_string and string_to_string. How can i fix this?
That was, because you only commented out the deprecate_clippy_lint!
macros, instead of removing them. cargo dev update_lints
only searches files for strings and does not parse Rust code.
clippy_lints/src/lib.rs
Outdated
mod str_to_string; | ||
mod string_to_string; |
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.
Those to lints should be in the same module. There is already a strings
module, so you can put these lints there.
And while you're there, you could combine all the LateLintPass
implementations in the strings
module into one. But please do this in an extra commit. (Or leave it for a later PR)
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.
Adding the two lints to the strings.rs file would do it? Also by combining all the LateLintPass
implementations do you mean that there should be only one of it for all the lints in string.rs file?
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.
do you mean that there should be only one of it for all the lints in string.rs file?
Yes, exactly.
Adding the two lints to the strings.rs file would do it?
You also have to copy over the code in the LateLintPass
impls, but you can reuse the LateLintPass
impl in the other module.
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.
I think combining all the LateLintPass
implementations could be done in a new PR
☔ The latest upstream changes (presumably #6351) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
24b3a63
to
9e0fdb4
Compare
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
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.
Some formulations. Remember to update the reference files after those changes.
Also, please squash your commits.
Made the requested changes, and squashed to a single commit |
@bors r+ Thanks! |
📌 Commit 2345ef5 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Please write a short comment explaining your change (or "none" for internal only changes)
changelog: un-deprecate [
str_to_string
] and [string_to_string
] and introduce them asrestriction
lints again.Fixes #5610
Added new lint:- str_to_string
r? @flip1995