1- error: unneeded late initalization
2- --> $DIR/let_if_seq.rs:48:5
3- |
4- LL | let foo;
5- | ^^^^^^^^
6- |
7- = note: `-D clippy::needless-late-init` implied by `-D warnings`
8- help: declare `foo` here
9- |
10- LL | let foo = if f() {
11- | +++++++++
12- help: remove the assignments from the branches
13- |
14- LL | 0
15- |
16- help: add a semicolon after the if expression
17- |
18- LL | };
19- | +
20-
211error: `if _ { .. } else { .. }` is an expression
22- --> $DIR/let_if_seq.rs:65 :5
2+ --> $DIR/let_if_seq.rs:66 :5
233 |
244LL | / let mut foo = 0;
255LL | | if f() {
@@ -31,7 +11,7 @@ LL | | }
3111 = note: you might not need `mut` at all
3212
3313error: `if _ { .. } else { .. }` is an expression
34- --> $DIR/let_if_seq.rs:70 :5
14+ --> $DIR/let_if_seq.rs:71 :5
3515 |
3616LL | / let mut bar = 0;
3717LL | | if f() {
@@ -45,7 +25,7 @@ LL | | }
4525 = note: you might not need `mut` at all
4626
4727error: `if _ { .. } else { .. }` is an expression
48- --> $DIR/let_if_seq.rs:78 :5
28+ --> $DIR/let_if_seq.rs:79 :5
4929 |
5030LL | / let quz;
5131LL | | if f() {
@@ -56,7 +36,7 @@ LL | | }
5636 | |_____^ help: it is more idiomatic to write: `let quz = if f() { 42 } else { 0 };`
5737
5838error: `if _ { .. } else { .. }` is an expression
59- --> $DIR/let_if_seq.rs:107 :5
39+ --> $DIR/let_if_seq.rs:108 :5
6040 |
6141LL | / let mut baz = 0;
6242LL | | if f() {
@@ -66,26 +46,5 @@ LL | | }
6646 |
6747 = note: you might not need `mut` at all
6848
69- error: unneeded late initalization
70- --> $DIR/let_if_seq.rs:78:5
71- |
72- LL | let quz;
73- | ^^^^^^^^
74- |
75- help: declare `quz` here
76- |
77- LL | let quz = if f() {
78- | +++++++++
79- help: remove the assignments from the branches
80- |
81- LL ~ 42
82- LL | } else {
83- LL ~ 0
84- |
85- help: add a semicolon after the if expression
86- |
87- LL | };
88- | +
89-
90- error: aborting due to 6 previous errors
49+ error: aborting due to 4 previous errors
9150
0 commit comments