-
Notifications
You must be signed in to change notification settings - Fork 1.8k
unnecessary_mut_passed: add structured suggestion
#15438
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
|
Lintcheck changes for 597d5a5
This comment will be updated if you push new changes |
|
@blyxyas friendly ping |
|
I haven't forgotten about this PR! Just that I'm preparing a talk and am currently a bit more focused on that. Still this PR was in the next batch to review, so a review will be made in the next few days Thanks for ping anyways, sometimes I actually forget about some PRs or issues =^w^= |
|
All good! Thanks for letting me know, and good luck with the talk:) |
b177b89 to
8d369a2
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.
Great starting point! Just a testing nit and a confirmation to change the sugg message.
8d369a2 to
99c6ebd
Compare
|
@rustbot ready |
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.
Could you also add check for raw pointers? Something like
fn takes_raw_const(a: *const i32) {}
fn takes_raw_mut(a: *mut i32) {}
[…]
// Raw pointers
let mut a = 42;
takes_raw_const(&mut a);
//~^ unnecessary_mut_passed
takes_raw_const(&raw mut a);
takes_raw_mut(&mut a);The takes_raw_const(&raw mut a) is not covered by this lint though, it could be later added as a new feature.
99c6ebd to
597d5a5
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Put the |
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, thanks! ❤️ The test suite is now great! So exhaustive =^w^=
resolves #8943
changelog: [
unnecessary_mut_passed]: add structured suggestion