Match wild err arm improvements
This lint should trigger on other identifiers which have `_` prefix (such as `_e`) and only if they are unused in the panic block.
_Note_: the `is_unused` function is greatly inspired from `pat_is_wild` function in [loops lints](43ac9416d9/clippy_lints/src/loops.rs (L1689)).
I've been considering doing some refactoring, maybe in utils. Maybe this PR or a new one. What do you think ?
fixes#5024
changelog: none
New lint: pats_with_wild_match_arm
Wildcard use with other pattern in same match arm.
The wildcard covers other(s) pattern(s) as it will match anyway.
changelog: add new lint when multiple patterns (including wildcard) are used in a match arm.
Fixes#4640.
Fix redundant_clone lint not working with PathBuf and OsString
https://github.com/rust-lang/rust-clippy/pull/4825 diabled MIR optimization in clippy, including `rustc_mir::transform::InstCombine` which reduces `&(*x)` to `x`. This PR tries to unwrap `&*` when looking into `mir::Rvalue`s.
Fixes#5014.
---
changelog: fixed `redundant_clone` lint not working with `PathBuf` and `OsString`
Detect usage of invalid atomic ordering modes such as
`Ordering::{Release, AcqRel}` in atomic loads and
`Ordering::{Acquire, AcqRel}` in atomic stores.
Use `mem::take` instead of `mem::replace` when applicable
`std::mem::take` can be used to replace a value of type `T` with `T::default()` instead of `std::mem::replace`.
Fixes issue #4871
changelog: Added lint for [`mem_replace_with_default`]
Fix ICE on `unsound_collection_transmute`
Fixes#4968
Check if `Ty`s are normalizable. It might show hidden false negative, I'm not sure.
Also, the regression tests are placed on two dirs, so move them to `/crashes`. I think it will be easier to find the right place.
changelog: Fix ICE on `unsound_collection_transmute`