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

proper applicability for obfuscated_if_else #14061

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

lapla-cogito
Copy link
Contributor

fix #14034

The currect implementation of obfuscated_if_else sometimes makes incorrect suggestions when the original code have side effects (see the example in the above issue). I think this can be fixed by changing the applicability depending on whether it can have side effects or not.

changelog: [obfuscated_if_else]: change applicability when the original code can have side effects

@rustbot
Copy link
Collaborator

rustbot commented Jan 22, 2025

r? @Centri3

rustbot has assigned @Centri3.
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 Jan 22, 2025
@lapla-cogito lapla-cogito force-pushed the issue_14034 branch 2 times, most recently from 8e31f2f to 632ec4b Compare January 22, 2025 23:31
@lapla-cogito lapla-cogito requested a review from Centri3 January 22, 2025 23:45
@lapla-cogito lapla-cogito force-pushed the issue_14034 branch 2 times, most recently from add9f0a to 5fc81d0 Compare January 26, 2025 00:56
@lapla-cogito
Copy link
Contributor Author

Rebased to resolve conflicts.

@Centri3 Centri3 added this pull request to the merge queue Jan 28, 2025
Merged via the queue into rust-lang:master with commit 66dc8a1 Jan 28, 2025
11 checks passed
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.

obfuscated_if_else doesn't check for side effects in subexpressions
3 participants