Skip to content

Conversation

Alexendoo
Copy link
Member

changelog: [identity_op]: add parenthesis to suggestions where required

Follow up to #8730, wraps the cases we can't lint as-is in parenthesis rather than ignoring them

Catches a couple new FPs with mixed operator precedences and as casts

// such as
0 + { a } * 2;
0 + a as usize;

The suggestions are now applied using span_lint_and_sugg rather than appearing in just the message and have a run-rustfix test

@rust-highfive
Copy link

r? @Manishearth

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 4, 2022
@xFrednet
Copy link
Contributor

xFrednet commented May 5, 2022

r? @dswij

I hope it's okay to steal this one from you @Manishearth 🙃

@xFrednet xFrednet assigned xFrednet and unassigned Manishearth May 5, 2022
@Manishearth
Copy link
Member

yeah please go for it!

Copy link
Member

@dswij dswij left a comment

Choose a reason for hiding this comment

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

LGTM! This is a nice improvement for sure, thank you!

r? @xFrednet

Comment on lines +80 to +84
// ensure we're checking against the leftmost expression of `right`
//
// ~~~ `lhs`
// 0 + {4} * 2
// ~~~~~~~ `right`
Copy link
Contributor

Choose a reason for hiding this comment

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

I love this kind of documentation ^^

@xFrednet
Copy link
Contributor

Looks good to me, thank you for the change! 👍

Also, thank you, @dswij, for the initial review 🙃

@bors r=dswij,xFrednet

@bors
Copy link
Contributor

bors commented May 24, 2022

📌 Commit ee8fae3 has been approved by dswij,xFrednet

@bors
Copy link
Contributor

bors commented May 24, 2022

⌛ Testing commit ee8fae3 with merge c41c410...

@bors
Copy link
Contributor

bors commented May 24, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: dswij,xFrednet
Pushing c41c410 to master...

@bors bors merged commit c41c410 into rust-lang:master May 24, 2022
@Alexendoo Alexendoo deleted the identity-op-suggestions branch May 25, 2022 10:47
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.

6 participants