Commit graph

18 commits

Author SHA1 Message Date
Samuel Tardieu
1ccef58dc0 useless_conversion: add needed adjustments to suggestion 2025-01-19 22:42:38 +01:00
Samuel Tardieu
ab5d55c996 Add more receivers to useless_conversion
- `ControlFlow::map_break()`
- `ControlFlow::map_continue()`
- `Iterator::map()`
2024-12-02 16:26:51 +01:00
Samuel Tardieu
9a692ec8cd Add more cases to the useless_conversion lint
The new cases are `x.map(f)` and `x.map_err(f)` when `f` is `Into::into`
or `From::from` with the same input and output types.
2024-11-30 21:57:16 +01:00
Obei Sideg
cd99729478 Update tests for hidden references to mutable static 2024-09-13 14:10:56 +03:00
Philipp Krones
aa220c7ee7 Merge commit '26ac6aab02' 2024-01-11 17:27:03 +01:00
Philipp Krones
772296c50e Merge commit '7671c283a5' into clippyup 2023-09-25 11:28:58 +02:00
Philipp Krones
cc61aeea54 Merge commit '080b587854' into clippyup 2023-08-24 21:32:12 +02:00
bors
d068043891 Auto merge of #11070 - y21:issue11065, r=flip1995
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes #11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616836099).
It *also* makes sure that the expression is not part of a macro call (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616919639). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed #10814, which introduced these issues)
2023-08-17 18:06:36 +02:00
Philipp Krones
cb3ecf7b79 Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00
Philipp Krones
b76b0aeb63 Merge commit '435a8ad86c' into clippyup 2023-05-20 15:39:26 +02:00
Philipp Krones
a1b75c5108 Merge commit 'a3ed905928' into clippyup 2023-04-23 13:28:56 +02:00
Philipp Krones
4ccafea92d Merge commit '4f3ab69ea0' into clippyup 2022-12-29 14:28:34 +01:00
r00ster91
599d9126a2 Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
flip1995
97705b7ea6 Merge commit '9e3cd88718' into clippyup 2021-05-20 13:07:57 +02:00
flip1995
d3d2018ead Merge commit '3e7c6dec24' into clippyup 2020-11-23 13:51:04 +01:00
flip1995
282c59820b Merge commit '3d0b0e66af' into clippyup 2020-08-28 18:43:25 +02:00
flip1995
d164ab65f7 Merge commit 'da5a6fb1b6' into clippyup 2020-07-26 21:07:07 +02:00
flip1995
f1d3086492 Merge commit 'e214ea82ad' into clippyup 2020-05-17 17:36:26 +02:00
Renamed from tests/ui/identity_conversion.fixed (Browse further)