Lint simple expressions in `manual_filter_map`, `manual_find_map`
changelog: Lint simple expressions in [`manual_filter_map`], [`manual_find_map`]
The current comparison rules out `.find(|a| a.is_some()).map(|b| b.unwrap())` because `a` being a reference can effect more complicated expressions, this adds a simple check for that case and adds the necessary derefs
There's some overlap with `option_filter_map` so `lint_filter_some_map_unwrap` now returns a `bool` to indicate it linted
Fix ICE in sugg::DerefDelegate with (named) closures
rustc comiler internals helpfully tell us how to fix the issue:
```
to get the signature of a closure, use `substs.as_closure().sig()` not `fn_sig()`
```
Fixes ICE in #9041
This also makes this code in `sugg::DerefDelegate` match a different use `typ.fn_sig(…)` I found: in `mixed_read_write_in_expression` -- being strict on the value of `typ.kind()` will hopefully reduce any future possibility of ICE crashes in this area.
---
changelog: none
rustc comiler internals helpfully tell us how to fix the issue:
to get the signature of a closure, use `substs.as_closure().sig()` not `fn_sig()`
Fixes ICE in #9041
the two loops did practically the same, only the type were different (&&
vs &), so I used `copied` to convert `&&` and chained them together.
Instead of parsing the trait info manually, I use the already provided
method `get_trait_info_from_bound`.
Also, instead of using manual string writing, I used `join` by
`itertools`.
Fix `undocumented_unsafe_blocks` in closures
fixes#9114
changelog: Fix `undocumented_unsafe_blocks` not checking for comments before the start of a closure
`new_without_default`: ignore const generics/lifetime params on `fn new`
Fixes#9113
No longer lints if `fn new` has any params
changelog: [`new_without_default`]: no longer lints const generics and lifetime params on `fn new`
Add `invalid_utf8_in_unchecked`
changelog: Add [`invalid_utf8_in_unchecked`]
closes: #629
Don't know how useful of a lint this is, just saw this was a really old issue 😄.
Correct lint version for `format_push_string`
Closes#9081
changelog: none
IDK what else to say. Look I can draw an ascii penguin =D:
```
(^v^)
<( )>
w w
```
Fix direct `#[allow]` attributes in `let_unit_value`
Fixes part of #9080
Not sure why it doesn't work when the lint is emitted at the statement, but switching it to the local works fine
changelog: Fix direct `#[allow]` attributes in [`let_unit_value`]
Changelog for Rust 1.62 🦖
This special artifact was just discovered. The artifact details changes to something called Clippy. Presently and from the context, we were unable to determine what this is supposed to be. All we know, is that it seems to have an active community around it which supports it. The members sometimes use paper clips as a secret symbol for Clippy.
I want to donate this artifact to the rust-lang organization, to have it displayed to the public.
---
changelog: none
Fix false-positive in `equatable_if_let`
Was linting in external macros. I guess now that I know about https://github.com/rust-lang/rust-clippy/pull/8694 it seems all kinda pointless until we resolve that.
Nevertheless, it's an improvement.
Fixes#9066.
changelog:`equatable_if_let` No longer lint on macros
Uncomment test for #8734
I believe the issue was an interaction between rustfix and `span_lint_and_sugg_for_edges`, so this would've been fixed by https://github.com/rust-lang/rust/pull/98261 (Thanks, `@WaffleLapkin!)`
Closes#8734
changelog: none