-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
needless_borrow
checks for mutable borrow
#7657
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
LL | mut_ref(&mut &mut b); // warn | ||
| ^^^^^^^^^^^ help: change this to: `&mut b` | ||
|
||
error: this expression borrows a reference (`&i32`) that is immediately dereferenced by the compiler |
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.
Should this error message say &mut i32
?
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.
Good catch!
Apart from @lopopolo 's suggestion, this looks good to merge. |
4fe307e
to
8938497
Compare
8938497
to
81d57de
Compare
📌 Commit 81d57de has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
closes #7635
changelog: [
needless_borrow
] now checks for needless mutable borrow