about summary refs log tree commit diff
path: root/clippy_lints/src/operators/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-02-03remove "Known problems" of `verbose_bit_mask`lapla-cogito-3/+0
2025-01-21docs: fix verbose-bit-mask exampleJoshua Wong-2/+2
changelog: none `x & 15 == 0` is not equivalent to `x.trailing_zeros() > 4`, as `x = 0b10000` is true for the former and false for the latter. In fact, clippy itself suggests the following: ```rust pub fn src(x: i32) -> bool { x & 15 == 0 // ~error: bit mask could be simplified with a call to `trailing_zeros` ^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4` } ```
2024-08-13fix indentation in docsAntoni Spaanderman-1/+1
2024-07-17Refactor for using config values:Jason Newcomb-9/+12
* Construct lint passes by taking `Conf` by reference. * Use `HashSet` configs in less places * Move some `check_crate` code into the pass constructor when possible.
2024-07-10Revert accidental "Why restrict this?" changeSander Saares-1/+1
2024-07-09Tidy the example code and ensure it builds as standalone snippetsSander Saares-1/+11
2024-07-09Replace incorrect suggested fix for `float_cmp`Sander Saares-35/+79
Using `f32::EPSILON` or `f64::EPSILON` as the floating-point equality comparison error margin is incorrect, yet `float_cmp` has until now recommended this be done. This change fixes the given guidance (both in docs and compiler hints) to not reference these unsuitable constants. Instead, the guidance now clarifies that the scenarios in which an absolute error margin is usable, provides a reference implementation of using a user-defined absolute error margin (as an absolute error margin can only be used-defined and may be different for different comparisons) and references the floating point guide for a reference implementation of relative error based equaltiy comparison for when absolute error margin cannot be used. changelog: Fix guidance of [`float_cmp`] and [`float_cmp_const`] to not incorrectly recommend `f64::EPSILON` as the error margin. Fixes #6816
2024-07-07Auto merge of #12966 - Rudxain:patch-1, r=dswijbors-2/+2
Clarify that `modulo_one` only applies to ints changelog: [`modulo_one`]: (docs) Clarify that it only applies to integers This might be nitpicky, but it's more technically correct. It also helps if a user skims through the docs, because they may believe it also applies to `{float}`s. This doc edit minimizes that possibility
2024-07-01Fix doc for verbose_bit_maskasemia-0/+14
2024-06-24Clarify that `modulo_one` only applies to intsRicardo Fernández Serrata-2/+2
2024-05-30Auto merge of #125764 - flip1995:clippy-subtree-update, r=Manishearthbors-6/+6
Clippy subtree update r? `@Manishearth`
2024-05-30Merge commit 'c9139bd546d9cd69df817faeab62c5f9b1a51337' into ↵Philipp Krones-6/+6
clippy-subtree-update
2024-05-29Don't require `visit_body` to take a lifetime that must outlive the function ↵Oli Scherer-2/+2
call
2024-02-08Merge commit '60cb29c5e4f9772685c9873752196725c946a849' into clippyupPhilipp Krones-3/+12
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-1/+1
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-36/+36
2023-10-06Merge commit 'b105fb4c39bc1a010807a6c076193cef8d93c109' into clippyupPhilipp Krones-2/+2
2023-08-11Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyupPhilipp Krones-0/+43
2023-06-10Drop uplifted `clippy:cmp_nan`Urgau-28/+0
2023-05-20Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyupPhilipp Krones-27/+0
2023-04-23Merge commit 'a3ed905928a03b6e433d0b429190bf3a847128b3' into clippyupPhilipp Krones-1/+1
2022-12-17Merge commit '4bdfb0741dbcecd5279a2635c3280726db0604b5' into clippyupPhilipp Krones-3/+0
2022-10-06Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyupPhilipp Krones-1/+1
2022-09-09Merge commit 'b52fb5234cd7c11ecfae51897a6f7fa52e8777fc' into clippyupPhilipp Krones-14/+18
2022-07-28Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyupPhilipp Krones-4/+43
2022-06-30Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyupPhilipp Krones-0/+849