diff options
| author | bors <bors@rust-lang.org> | 2021-11-27 14:24:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-27 14:24:02 +0000 |
| commit | 3720735f9abb7e5dca142a03db8063579bfca6b0 (patch) | |
| tree | cfab77509b2597644538a8c8cb56d1ff6d676a97 /compiler/rustc_codegen_llvm/src | |
| parent | 5a6169d7f662bfa418f4dc1d1cb6bf725dd5f680 (diff) | |
| parent | d346ec94fe3477ee2ee0cf41061a92c156db8701 (diff) | |
| download | rust-3720735f9abb7e5dca142a03db8063579bfca6b0.tar.gz rust-3720735f9abb7e5dca142a03db8063579bfca6b0.zip | |
Auto merge of #7995 - Alexendoo:needless_late_init, r=giraffate
Add `needless_late_init` lint
examples:
```rust
let a;
a = 1;
// to
let a = 1;
```
```rust
let b;
match 3 {
0 => b = "zero",
1 => b = "one",
_ => b = "many",
}
// to
let b = match 3 {
0 => "zero",
1 => "one",
_ => "many",
};
```
```rust
let c;
if true {
c = 1;
} else {
c = -1;
}
// to
let c = if true {
1
} else {
-1
};
```
changelog: Add [`needless_late_init`]
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
