Skip to content
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

Don't suggest keeping borrows in identity_op #10004

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Nov 30, 2022

fixes #9904
changelog: identity_op: Don't suggest keeping borrows

@rustbot
Copy link
Collaborator

rustbot commented Nov 30, 2022

r? @llogiq

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 30, 2022
@@ -20,20 +20,76 @@ pub(crate) fn check<'tcx>(
if !is_allowed(cx, op, left, right) {
match op {
BinOpKind::Add | BinOpKind::BitOr | BinOpKind::BitXor => {
check_op(cx, left, 0, expr.span, right.span, needs_parenthesis(cx, expr, right));
check_op(cx, right, 0, expr.span, left.span, Parens::Unneeded);
check_op(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder if there's a way to refactor this to be less code, but I don't think it should keep us from landing this.

@llogiq
Copy link
Contributor

llogiq commented Dec 9, 2022

Thank you!

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 9, 2022

📌 Commit 03ba0ea has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Dec 9, 2022

⌛ Testing commit 03ba0ea with merge 5a3a722...

@bors
Copy link
Collaborator

bors commented Dec 9, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 5a3a722 to master...

@bors bors merged commit 5a3a722 into rust-lang:master Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

identity_op fails to deal with references properly: &0 + 0
4 participants