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

Fix/Issue11932: assert* in multi-condition after unrolling will cause lint nonminimal_bool emit warning #12083

Merged
merged 2 commits into from
Jan 27, 2024

Conversation

cocodery
Copy link
Contributor

@cocodery cocodery commented Jan 3, 2024

fixes Issue#11932

After assert, assert_eq, assert_ne, etc, assert family marcos unrolling in multi-condition expressions, lint nonminimal_bool will recognize whole expression as a entirety, analyze each simple condition expr of them, and check whether can simplify them.

But assert itself is a entirety to programmers, we don't need to lint on assert. This commit add check whether lint snippet contains assert when try to warning to an expression.

changelog: [nonminimal_bool] add check for condition expression

@rustbot
Copy link
Collaborator

rustbot commented Jan 3, 2024

r? @Alexendoo

(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 Jan 3, 2024
@cocodery cocodery requested a review from Alexendoo January 6, 2024 11:50
@Alexendoo
Copy link
Member

Thank you!

@bors r+

@bors
Copy link
Contributor

bors commented Jan 27, 2024

📌 Commit bd6e920 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 27, 2024

⌛ Testing commit bd6e920 with merge 276ce39...

@bors
Copy link
Contributor

bors commented Jan 27, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 276ce39 to master...

@bors bors merged commit 276ce39 into rust-lang:master Jan 27, 2024
5 checks passed
@cocodery cocodery deleted the fix/issue11932 branch January 28, 2024 05: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.

nonminimal_bool complains about asserts in boolean expressions
4 participants