rust/clippy_utils/src
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
..
ast_utils Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ast_utils.rs Merge commit 'dc5423ad44' into clippyup 2022-03-14 12:02:53 +01:00
attrs.rs Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
comparisons.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
consts.rs assertions_on_constants: ignore indirect cfg! 2022-04-13 22:47:08 -06:00
diagnostics.rs Merge remote-tracking branch 'upstream/master' into rustup 2022-04-07 15:44:37 +01:00
eager_or_lazy.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
higher.rs Merge commit '57b3c4b90f' into clippyup 2022-02-10 18:40:06 +01:00
hir_utils.rs Compare inline constants by their bodies rather than value in SpanlessEq 2022-04-10 00:54:41 -04:00
lib.rs Merge remote-tracking branch 'upstream/master' into rustup 2022-04-07 15:44:37 +01:00
macros.rs adding spell checking 2022-04-15 14:18:09 -07:00
msrvs.rs New lint is_digit_ascii_radix 2022-04-07 14:14:30 -06:00
numeric_literal.rs New lint is_digit_ascii_radix 2022-04-07 14:14:30 -06:00
paths.rs add checking type 2022-04-19 10:48:12 +09:00
ptr.rs Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
qualify_min_const_fn.rs Remove opaque type obligation and just register opaque types as they are encountered. 2022-03-28 16:57:45 +00:00
source.rs adding spell checking 2022-04-15 14:18:09 -07:00
str_utils.rs Merge commit '0eff589afc' into clippyup 2021-12-30 15:10:43 +01:00
sugg.rs New lint format_add_strings 2022-04-13 22:48:36 -06:00
sym_helper.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ty.rs needless_late_init: ignore if let, let mut and significant drops 2022-04-26 13:16:54 +01:00
usage.rs Check for loops/closures in local_used_after_expr 2022-04-10 14:26:44 +01:00
visitors.rs Allow more complex expressions in let_unit_value 2022-04-14 21:34:33 -04:00