Skip to content

[arithmetic_side_effects] Consider referenced allowed or hard-coded types #10768

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

Merged
merged 1 commit into from
May 14, 2023

Conversation

c410-f3r
Copy link
Contributor

Fix #10767

changelog: [`arithmetic_side_effects`]: Do not fire when dealing with allowed or hard-coded types that are referenced.

@rustbot
Copy link
Collaborator

rustbot commented May 10, 2023

r? @Jarcho

(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 May 10, 2023
@Jarcho
Copy link
Contributor

Jarcho commented May 13, 2023

This should be remove the references from the type before converting it to a string. A type with a named lifetime has it appear in the string.

@c410-f3r
Copy link
Contributor Author

peel_hir_expr_refs is being called before the conversion to string in has_allowed_binary, which I am assuming that already strips all types of lifetimes. Should I use another method?

@Jarcho
Copy link
Contributor

Jarcho commented May 13, 2023

peel_hir_expr_refs only strips away the & operator, not all references on the type. There's a peel_refs function on Ty you can use.

@c410-f3r
Copy link
Contributor Author

Done. Thank you @Jarcho

@Jarcho
Copy link
Contributor

Jarcho commented May 14, 2023

Thank you. @bors r+

@bors
Copy link
Contributor

bors commented May 14, 2023

📌 Commit 891fffe has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 14, 2023

⌛ Testing commit 891fffe with merge a167973...

@bors
Copy link
Contributor

bors commented May 14, 2023

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

@bors bors merged commit a167973 into rust-lang:master May 14, 2023
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.

[arithmetic_side_effects] Referenced allowed or hard-coded types should not fire the lint
4 participants