rust-clippy/clippy_lints/src/matches
bors 95396f61bc Auto merge of #8617 - Alexendoo:relax-needless-late-init, r=giraffate
`needless_late_init`: ignore `if let`, `let mut` and significant drops

No longer lints `if let`, personal taste on this one is pretty split, so it probably shouldn't be warning by default. Fixes #8613

```rust
let x = if let Some(n) = y {
    n
} else {
    1
}
```

No longer lints `let mut`, things like the following are not uncommon and look fine as they are

b169c16d86/src/sixty_four.rs (L88-L93)

Avoids changing the drop order in an observable way, where the type of `x` has a drop with side effects and something between `x` and the first use also does, e.g.

48cc6cb791/tests/test_api.rs (L159-L167)

The implementation of `type_needs_ordered_drop_inner` was changed a bit, it now uses `Ty::has_significant_drop` and reordered the ifs to check diagnostic name before checking the implicit drop impl

changelog: [`needless_late_init`]: No longer lints `if let` statements, `let mut` bindings and no longer significantly changes drop order
2022-04-27 00:11:17 +00:00
..
infallible_destructuring_match.rs initialization misspell 2022-04-15 14:19:00 -07:00
match_as_ref.rs Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup 2022-02-10 18:40:06 +01:00
match_bool.rs Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup 2022-02-10 18:40:06 +01:00
match_like_matches.rs Merge commit 'e329249b6a3a98830d860c74c8234a8dd9407436' into clippyup 2022-02-26 14:26:21 +01:00
match_ref_pats.rs Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup 2022-02-10 18:40:06 +01:00
match_same_arms.rs adding spell checking 2022-04-15 14:18:09 -07:00
match_single_binding.rs Merge commit 'e329249b6a3a98830d860c74c8234a8dd9407436' into clippyup 2022-02-26 14:26:21 +01:00
match_wild_enum.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
match_wild_err_arm.rs Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup 2022-02-10 18:40:06 +01:00
mod.rs adding spell checking 2022-04-15 14:18:09 -07:00
needless_match.rs Fix needless_match false positive for if-let 2022-04-18 14:33:13 +09:00
overlapping_arms.rs Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup 2022-02-10 18:40:06 +01:00
redundant_pattern_match.rs needless_late_init: ignore if let, let mut and significant drops 2022-04-26 13:16:54 +01:00
rest_pat_in_fully_bound_struct.rs Do not apply rest_pat_in_fully_bound_structs on #[non_exhaustive] structs 2022-04-11 22:47:04 -05:00
single_match.rs Overhaul TyS and Ty. 2022-02-15 16:03:24 +11:00
wild_in_or_pats.rs Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup 2022-02-10 18:40:06 +01:00