Skip to content

Conversation

mdm
Copy link
Contributor

@mdm mdm commented Jan 20, 2024

closes #12006

By default, don't warn about modulo arithmetic when comparing to zero. This behavior is configurable via clippy.toml.

See discussion on Zulip

changelog: [modulo_arithmetic]: By default don't lint when comparing the result of a modulo operation to zero.

@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2024

r? @llogiq

(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 20, 2024
@bors
Copy link
Contributor

bors commented Jan 20, 2024

☔ The latest upstream changes (presumably #12144) made this pull request unmergeable. Please resolve the merge conflicts.

@llogiq
Copy link
Contributor

llogiq commented Jan 21, 2024

Thank you, r=me after a rebase.

@mdm mdm force-pushed the modulo-arithmetic-comparison-to-zero branch 2 times, most recently from db99c3e to 7078f18 Compare January 23, 2024 20:11
@mdm
Copy link
Contributor Author

mdm commented Jan 23, 2024

@llogiq I rebased. Is there anything else you need me to do? Sorry if I missed something obvious. I'm a new contributor.

@bors
Copy link
Contributor

bors commented Jan 24, 2024

☔ The latest upstream changes (presumably #12179) made this pull request unmergeable. Please resolve the merge conflicts.

@mdm mdm force-pushed the modulo-arithmetic-comparison-to-zero branch from 7078f18 to 7af81b7 Compare January 25, 2024 11:30
Add lint configuration for `modulo_arithmetic`

Collect meta-data
@mdm mdm force-pushed the modulo-arithmetic-comparison-to-zero branch from 7af81b7 to e456c28 Compare January 25, 2024 11:43
@llogiq
Copy link
Contributor

llogiq commented Jan 27, 2024

Thank you! Sorry for the delay.

@bors r+

@bors
Copy link
Contributor

bors commented Jan 27, 2024

📌 Commit e456c28 has been approved by llogiq

It is now in the queue for this repository.

bors added a commit that referenced this pull request Jan 27, 2024
…ogiq

Don't warn about modulo arithmetic when comparing to zero

closes #12006

By default, don't warn about modulo arithmetic when comparing to zero. This behavior is configurable via `clippy.toml`.

See discussion [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.E2.9C.94.20Is.20issue.20.2312006.20worth.20implementing.3F)

changelog: [`modulo_arithmetic`]: By default don't lint when comparing the result of a modulo operation to zero.
@bors
Copy link
Contributor

bors commented Jan 27, 2024

⌛ Testing commit e456c28 with merge e7894bb...

@bors
Copy link
Contributor

bors commented Jan 27, 2024

💔 Test failed - checks-action_test

@llogiq
Copy link
Contributor

llogiq commented Jan 27, 2024

@bors retry

Seems the Mac runner is acting up again

@bors
Copy link
Contributor

bors commented Jan 27, 2024

⌛ Testing commit e456c28 with merge 855aa08...

@bors
Copy link
Contributor

bors commented Jan 27, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 855aa08 to master...

@bors bors merged commit 855aa08 into rust-lang:master Jan 27, 2024
@mdm mdm deleted the modulo-arithmetic-comparison-to-zero branch January 27, 2024 22: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.

modulo_arithmetic should not trigger if result is only checked to be zero or non-zero
4 participants