]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_late_init.stderr
Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup
[rust.git] / tests / ui / needless_late_init.stderr
1 error: unneeded late initalization
2   --> $DIR/needless_late_init.rs:4:5
3    |
4 LL |     let a;
5    |     ^^^^^^
6    |
7    = note: `-D clippy::needless-late-init` implied by `-D warnings`
8 help: declare `a` here
9    |
10 LL |     let a = match n {
11    |     +++++++
12 help: remove the assignments from the `match` arms
13    |
14 LL ~         1 => "one",
15 LL |         _ => {
16 LL ~             "two"
17    |
18 help: add a semicolon after the `match` expression
19    |
20 LL |     };
21    |      +
22
23 error: unneeded late initalization
24   --> $DIR/needless_late_init.rs:13:5
25    |
26 LL |     let b;
27    |     ^^^^^^
28    |
29 help: declare `b` here
30    |
31 LL |     let b = if n == 3 {
32    |     +++++++
33 help: remove the assignments from the branches
34    |
35 LL ~         "four"
36 LL |     } else {
37 LL ~         "five"
38    |
39 help: add a semicolon after the `if` expression
40    |
41 LL |     };
42    |      +
43
44 error: unneeded late initalization
45   --> $DIR/needless_late_init.rs:20:5
46    |
47 LL |     let c;
48    |     ^^^^^^
49    |
50 help: declare `c` here
51    |
52 LL |     let c = if let Some(n) = Some(5) {
53    |     +++++++
54 help: remove the assignments from the branches
55    |
56 LL ~         n
57 LL |     } else {
58 LL ~         -50
59    |
60 help: add a semicolon after the `if` expression
61    |
62 LL |     };
63    |      +
64
65 error: unneeded late initalization
66   --> $DIR/needless_late_init.rs:27:5
67    |
68 LL |     let d;
69    |     ^^^^^^
70    |
71 help: declare `d` here
72    |
73 LL |     let d = if true {
74    |     +++++++
75 help: remove the assignments from the branches
76    |
77 LL ~         temp
78 LL |     } else {
79 LL ~         15
80    |
81 help: add a semicolon after the `if` expression
82    |
83 LL |     };
84    |      +
85
86 error: unneeded late initalization
87   --> $DIR/needless_late_init.rs:35:5
88    |
89 LL |     let e;
90    |     ^^^^^^
91    |
92 help: declare `e` here
93    |
94 LL |     let e = if true {
95    |     +++++++
96 help: remove the assignments from the branches
97    |
98 LL ~         format!("{} {}", a, b)
99 LL |     } else {
100 LL ~         format!("{}", c)
101    |
102 help: add a semicolon after the `if` expression
103    |
104 LL |     };
105    |      +
106
107 error: unneeded late initalization
108   --> $DIR/needless_late_init.rs:50:5
109    |
110 LL |     let a;
111    |     ^^^^^^
112    |
113 help: declare `a` here
114    |
115 LL |     let a = match n {
116    |     +++++++
117 help: remove the assignments from the `match` arms
118    |
119 LL ~         1 => f().await,
120 LL |         _ => {
121 LL ~             "two"
122    |
123 help: add a semicolon after the `match` expression
124    |
125 LL |     };
126    |      +
127
128 error: unneeded late initalization
129   --> $DIR/needless_late_init.rs:67:5
130    |
131 LL |     let a;
132    |     ^^^^^^
133    |
134 help: declare `a` here
135    |
136 LL |     let a = match n {
137    |     +++++++
138 help: remove the assignments from the `match` arms
139    |
140 LL ~         1 => f(),
141 LL |         _ => {
142 LL ~             "two"
143    |
144 help: add a semicolon after the `match` expression
145    |
146 LL |     };
147    |      +
148
149 error: aborting due to 7 previous errors
150