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
-
21
1
error: `if _ { .. } else { .. }` is an expression
22
- --> $DIR/let_if_seq.rs:65 :5
2
+ --> $DIR/let_if_seq.rs:66 :5
23
3
|
24
4
LL | / let mut foo = 0;
25
5
LL | | if f() {
@@ -31,7 +11,7 @@ LL | | }
31
11
= note: you might not need `mut` at all
32
12
33
13
error: `if _ { .. } else { .. }` is an expression
34
- --> $DIR/let_if_seq.rs:70 :5
14
+ --> $DIR/let_if_seq.rs:71 :5
35
15
|
36
16
LL | / let mut bar = 0;
37
17
LL | | if f() {
@@ -45,7 +25,7 @@ LL | | }
45
25
= note: you might not need `mut` at all
46
26
47
27
error: `if _ { .. } else { .. }` is an expression
48
- --> $DIR/let_if_seq.rs:78 :5
28
+ --> $DIR/let_if_seq.rs:79 :5
49
29
|
50
30
LL | / let quz;
51
31
LL | | if f() {
@@ -56,7 +36,7 @@ LL | | }
56
36
| |_____^ help: it is more idiomatic to write: `let quz = if f() { 42 } else { 0 };`
57
37
58
38
error: `if _ { .. } else { .. }` is an expression
59
- --> $DIR/let_if_seq.rs:107 :5
39
+ --> $DIR/let_if_seq.rs:108 :5
60
40
|
61
41
LL | / let mut baz = 0;
62
42
LL | | if f() {
@@ -66,26 +46,5 @@ LL | | }
66
46
|
67
47
= note: you might not need `mut` at all
68
48
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
91
50
0 commit comments