diff options
| author | bors <bors@rust-lang.org> | 2022-04-27 00:11:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-04-27 00:11:17 +0000 |
| commit | 95396f61bcc3f9439132d57dcd21b6aa0a5deb73 (patch) | |
| tree | 8e7328b624df3124bd18a6bb38c85cbd07af1b22 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 94623ee882d6c598e09cd0787fcc62bd98d88d94 (diff) | |
| parent | 1d1fecff0fbb727919067a1a6a5d28d30c693cd3 (diff) | |
| download | rust-95396f61bcc3f9439132d57dcd21b6aa0a5deb73.tar.gz rust-95396f61bcc3f9439132d57dcd21b6aa0a5deb73.zip | |
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
https://github.com/shepmaster/twox-hash/blob/b169c16d86eb8ea4a296b0acb9d00ca7e3c3005f/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.
https://github.com/denoland/rusty_v8/blob/48cc6cb791cac57d22fab1a2feaa92da8ddc9a68/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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
