Skip to content

Extend manual_is_variant_and lint to check for boolean map comparisons #14646

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Apr 17, 2025

Fixes #14542.

changelog: Extend manual_is_variant_and lint to check for boolean map comparisons

r? @samueltardieu

@rustbot
Copy link
Collaborator

rustbot commented Apr 17, 2025

samueltardieu is on vacation.

Please choose another assignee.

@rustbot
Copy link
Collaborator

rustbot commented Apr 17, 2025

r? @blyxyas

rustbot has assigned @blyxyas.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 17, 2025
@GuillaumeGomez GuillaumeGomez force-pushed the extend-manual_is_variant_and branch from 0b94b9e to 8913c0e Compare April 17, 2025 15:55
@GuillaumeGomez
Copy link
Member Author

Fixed fmt

Comment on lines 16 to 18
expr: &'tcx Expr<'_>,
map_recv: &'tcx Expr<'_>,
map_arg: &'tcx Expr<'_>,
Copy link
Contributor

@samueltardieu samueltardieu Apr 17, 2025

Choose a reason for hiding this comment

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

I think all those explicit 'tcx lifetimes can be removed, as well as the function generic 'tcx parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah indeed!

@GuillaumeGomez GuillaumeGomez force-pushed the extend-manual_is_variant_and branch from 8913c0e to f65ce46 Compare April 18, 2025 08:42
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.

manual_is_variant_and should also trigger for some_option.map(|x| x.is_foo) == Some(true)
4 participants