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

Wrap transmutes_expressible_as_ptr_casts suggestions in parentheses #10454

Merged

Conversation

Alexendoo
Copy link
Member

changelog: [transmutes_expressible_as_ptr_casts]: Fix suggestion missing wrapping parentheses

Fixes #10449

r? @Jarcho

Is this the best way to go about this? unused_parens will catch the unnecessary ones but emitting them in the first place isn't ideal

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 5, 2023
@Jarcho
Copy link
Contributor

Jarcho commented Mar 5, 2023

You can check if the parent expression's precedence is >=PREC_PREFIX. I don't think as casting has a constant.

@Jarcho
Copy link
Contributor

Jarcho commented Mar 23, 2023

ping @Alexendoo

@Alexendoo Alexendoo force-pushed the transmutes-expressible-as-ptr-casts-parens branch from 1a90c7d to ecc2012 Compare March 23, 2023 18:58
@Jarcho
Copy link
Contributor

Jarcho commented Mar 25, 2023

Thank you. @bors r+

@bors
Copy link
Collaborator

bors commented Mar 25, 2023

📌 Commit ecc2012 has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 25, 2023

⌛ Testing commit ecc2012 with merge f1b9105...

@bors
Copy link
Collaborator

bors commented Mar 25, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing f1b9105 to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented Mar 25, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing f1b9105 to master...

@bors bors merged commit f1b9105 into rust-lang:master Mar 25, 2023
@Alexendoo Alexendoo deleted the transmutes-expressible-as-ptr-casts-parens branch March 25, 2023 11:37
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.

FP transmutes_expressible_as_ptr_casts: type fn() cannot be dereferenced
4 participants