2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-04-01 17:23:47 +00:00
|
|
|
--> $DIR/needless_late_init.rs:15:5
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
LL | let a;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-late-init` implied by `-D warnings`
|
|
|
|
help: declare `a` here
|
|
|
|
|
|
|
|
|
LL | let a = match n {
|
|
|
|
| +++++++
|
|
|
|
help: remove the assignments from the `match` arms
|
|
|
|
|
|
|
|
|
LL ~ 1 => "one",
|
|
|
|
LL | _ => {
|
|
|
|
LL ~ "two"
|
|
|
|
|
|
|
|
|
help: add a semicolon after the `match` expression
|
|
|
|
|
|
|
|
|
LL | };
|
|
|
|
| +
|
|
|
|
|
2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-04-01 17:23:47 +00:00
|
|
|
--> $DIR/needless_late_init.rs:24:5
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
LL | let b;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `b` here
|
|
|
|
|
|
|
|
|
LL | let b = if n == 3 {
|
|
|
|
| +++++++
|
|
|
|
help: remove the assignments from the branches
|
|
|
|
|
|
|
|
|
LL ~ "four"
|
|
|
|
LL | } else {
|
|
|
|
LL ~ "five"
|
|
|
|
|
|
|
|
|
help: add a semicolon after the `if` expression
|
|
|
|
|
|
|
|
|
LL | };
|
|
|
|
| +
|
|
|
|
|
2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-04-01 17:23:47 +00:00
|
|
|
--> $DIR/needless_late_init.rs:31:5
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
LL | let d;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `d` here
|
|
|
|
|
|
|
|
|
LL | let d = if true {
|
|
|
|
| +++++++
|
|
|
|
help: remove the assignments from the branches
|
|
|
|
|
|
|
|
|
LL ~ temp
|
|
|
|
LL | } else {
|
|
|
|
LL ~ 15
|
|
|
|
|
|
|
|
|
help: add a semicolon after the `if` expression
|
|
|
|
|
|
|
|
|
LL | };
|
|
|
|
| +
|
|
|
|
|
2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-04-01 17:23:47 +00:00
|
|
|
--> $DIR/needless_late_init.rs:39:5
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
LL | let e;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `e` here
|
|
|
|
|
|
|
|
|
LL | let e = if true {
|
|
|
|
| +++++++
|
|
|
|
help: remove the assignments from the branches
|
|
|
|
|
|
|
|
|
LL ~ format!("{} {}", a, b)
|
|
|
|
LL | } else {
|
2022-04-01 17:23:47 +00:00
|
|
|
LL ~ format!("{}", n)
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
help: add a semicolon after the `if` expression
|
|
|
|
|
|
|
|
|
LL | };
|
|
|
|
| +
|
|
|
|
|
2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-04-01 17:23:47 +00:00
|
|
|
--> $DIR/needless_late_init.rs:46:5
|
2021-12-17 11:22:41 +00:00
|
|
|
|
|
|
|
|
LL | let f;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `f` here
|
|
|
|
|
|
|
|
|
LL | let f = match 1 {
|
|
|
|
| +++++++
|
|
|
|
help: remove the assignments from the `match` arms
|
|
|
|
|
|
|
|
|
LL - 1 => f = "three",
|
|
|
|
LL + 1 => "three",
|
|
|
|
|
|
|
|
|
|
2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-04-01 17:23:47 +00:00
|
|
|
--> $DIR/needless_late_init.rs:52:5
|
2021-12-17 11:22:41 +00:00
|
|
|
|
|
|
|
|
LL | let g: usize;
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `g` here
|
|
|
|
|
|
|
|
|
LL | let g: usize = if true {
|
|
|
|
| ++++++++++++++
|
|
|
|
help: remove the assignments from the branches
|
|
|
|
|
|
|
|
|
LL - g = 5;
|
|
|
|
LL + 5
|
|
|
|
|
|
|
|
|
help: add a semicolon after the `if` expression
|
|
|
|
|
|
|
|
|
LL | };
|
|
|
|
| +
|
|
|
|
|
2022-04-01 17:23:47 +00:00
|
|
|
error: unneeded late initialization
|
|
|
|
--> $DIR/needless_late_init.rs:60:5
|
|
|
|
|
|
|
|
|
LL | let x;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `x` here
|
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ~~~~~
|
|
|
|
|
2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/needless_late_init.rs:64:5
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
2022-04-01 17:23:47 +00:00
|
|
|
LL | let x;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `x` here
|
|
|
|
|
|
|
|
|
LL | let x = SignificantDrop;
|
|
|
|
| ~~~~~
|
|
|
|
|
|
|
|
error: unneeded late initialization
|
|
|
|
--> $DIR/needless_late_init.rs:68:5
|
|
|
|
|
|
|
|
|
LL | let x;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `x` here
|
|
|
|
|
|
|
|
|
LL | let x = SignificantDrop;
|
|
|
|
| ~~~~~
|
|
|
|
|
|
|
|
error: unneeded late initialization
|
|
|
|
--> $DIR/needless_late_init.rs:87:5
|
|
|
|
|
|
2021-12-06 11:33:31 +00:00
|
|
|
LL | let a;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `a` here
|
|
|
|
|
|
|
|
|
LL | let a = match n {
|
|
|
|
| +++++++
|
|
|
|
help: remove the assignments from the `match` arms
|
|
|
|
|
|
|
|
|
LL ~ 1 => f().await,
|
|
|
|
LL | _ => {
|
|
|
|
LL ~ "two"
|
|
|
|
|
|
|
|
|
help: add a semicolon after the `match` expression
|
|
|
|
|
|
|
|
|
LL | };
|
|
|
|
| +
|
|
|
|
|
2022-04-15 19:00:44 +00:00
|
|
|
error: unneeded late initialization
|
2022-04-01 17:23:47 +00:00
|
|
|
--> $DIR/needless_late_init.rs:104:5
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
LL | let a;
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: declare `a` here
|
|
|
|
|
|
|
|
|
LL | let a = match n {
|
|
|
|
| +++++++
|
|
|
|
help: remove the assignments from the `match` arms
|
|
|
|
|
|
|
|
|
LL ~ 1 => f(),
|
|
|
|
LL | _ => {
|
|
|
|
LL ~ "two"
|
|
|
|
|
|
|
|
|
help: add a semicolon after the `match` expression
|
|
|
|
|
|
|
|
|
LL | };
|
|
|
|
| +
|
|
|
|
|
2022-04-01 17:23:47 +00:00
|
|
|
error: aborting due to 11 previous errors
|
2021-12-06 11:33:31 +00:00
|
|
|
|